Android Question Keycode and KEYCODE_NUMPAD_0 -> KEYCODE_NUMPAD_9

Robert Valentino

Well-Known Member
Licensed User
Longtime User
Keycodes does not have a name or value for the KEYCODE_NUMPAD_0 through KEYCODE_NUMPAD_9

Is it possible to add them. I am using the values 144 -> 153 turns out the Lenovo IdeaPad 3 Chrome 15IJL6 Model# 82N4002HUS, has a numeric keypad and must generate these values because the values 1 -> 0 on the top row work fine but the keypad numbers don't
 

Robert Valentino

Well-Known Member
Licensed User
Longtime User
Don't think so. There is a separate keypad for the number keys. But I really can't say for sure.

1706973654331.png
 
Upvote 0

BlueVision

Active Member
Licensed User
Longtime User
Ok, so obviously no NUMLOCK button...
On various other keyboard layouts, there is this key, probably because of the multiple assignment of these keys (often the arrow keys are also integrated there).
Which code do you use to query the keys? Can you post a snippet of code?

This device runs ChromeOS, an operating system that I honestly haven't really got to grips with yet. B4A code should actually work on it. But that's one of those things. Should doesn't mean must.
I assume you have programmed some kind of keyboard logger to query the keys?
 
Last edited:
Upvote 0

Robert Valentino

Well-Known Member
Licensed User
Longtime User
Checking for values 144 -> 153 works fine.

it is keycodes doesn't define them
B4X:
            If  KeyCode >= KeyCodes.KEYCODE_0 And KeyCode <= KeyCodes.KEYCODE_9 Then  
                sID_KB_Key(mKeyNumbers(KeyCode - KeyCodes.KEYCODE_0)) 
                Return True
'            else if KeyCode >= KeyCodes.KEYCODE_NUMPAD_0 And KeyCode <= KeyCodes.KEYCODE_NUMPAD_9 Then          
'                    sID_KB_Key(mKeyNumbers(KeyCode - KeyCodes.KEYCODE_NUMPAD_0)) 
'                    Return True            
            else if KeyCode >= 144 And KeyCode <= 153 Then
                    sID_KB_Key(mKeyNumbers(KeyCode - 144))                    
            End If
 
Upvote 0

BlueVision

Active Member
Licensed User
Longtime User
Well, as I said before. Can't check it on my device, it's a Windows Laptop without a NUMPAD. Maybe others can check your code with matching hardware. Most of them will use Windows as Operating System.
I can see in your code, you do a "translation" for getting a match. Best what you can do.

Next step is to check, if this is depending on Operating System (Windows vs. Android vs. ChromeOS). Hope for you this behave is standard on ChromeOS, then you fixed it already with the translation in your code and you are able to run this code on every ChromeOS driven machine.

Be careful. I read that the follower ChromOs Flex does not support native Android Applications. And again. I can't prove that.
Hope my thoughts helped you in finding a solution. If it works, well done. Test your code on different machines if possible!
 
Upvote 0
Top