B4J Question B4X GameViewHelper.AddKeyListener - 'Insert' key not working?

MikeH

Well-Known Member
Licensed User
Longtime User
As per title, on two keyboards I've checked, 'Insert' doesn't work.

Is there a reason?
Does it work for you?
 

MikeH

Well-Known Member
Licensed User
Longtime User
Usually when you want to check a keycode that keycode should be in capital letters: INSERT
I am not sure how GameViewHelper works with the keycodes because i am not using it.
I use the Main_KeyPressed_Event(e As Event) from a thread on the forum: keyboard event detect CTRL+X
It isn't even showing with this code:

B4X:
Sub KBD_KeyPressed (KeyCode As String) As Boolean

    Log("KeyPressed: " & KeyCode)

(All other keys work as expected)
 
Upvote 0

MikeH

Well-Known Member
Licensed User
Longtime User
In the Asteroids example that comes with the jGameViewHelper library I can use the Insert key.
Gameview
Can you post your test project so others can have a closer look at it?
The project is quite large but the code I put previously works perfectly for every key apart from 'Insert". I thought it was my Mac keyboard at first but have also tried it with a Windows keyboard with the same result.
 
Upvote 0

MikeH

Well-Known Member
Licensed User
Longtime User
Did you try the alternative i mentioned in message #2. Just to see if you can somehow detect the INSERT key?
Not yet. I can get by without that key for now and I'm on a deadline so not much time for experimenting.
 
Upvote 0

Brian Dean

Well-Known Member
Licensed User
Longtime User
This will not be much help, but using this key receiver . . .
B4X:
Public Sub key_KeyPressed (KeyCode As String) As Boolean
    Log("Key received = " & KeyCode)
End Sub
. . . I get the Log message . . .
B4X:
Key received = Insert
So there does not appear to be anything special about the Insert key.

The game view helper is declared as follows, but I am sure that you have done the same . . .
B4X:
    Private gvh As GameViewHelper
    . . .
    . . .   
    gvh.AddKeyListener("key", MainForm)
 
Upvote 0
Top