Android Question KeyCodes updated

Robert Valentino

Well-Known Member
Licensed User
Longtime User
I download the KeyCode source and added the symbolic defines for the Number Pad Numbers (KEYCODE_NUMPAD_0, ... KEYCODE_NUMPAD_9)

How do I get this java file to be used instead of the core KeyCodes?

Or better yet how do I get this KeyCodes into the core library without making my own IDE
 

Attachments

  • KeyCodes.java
    5.9 KB · Views: 167

teddybear

Well-Known Member
Licensed User
Why do you want to modify core KeyCodes? you have known their constant about (KEYCODE_NUMPAD_0, ... KEYCODE_NUMPAD_9), if you only would like to use the name to describle the constant is what about, you can define all of them in a code module.
 
Last edited:
Upvote 0

Robert Valentino

Well-Known Member
Licensed User
Longtime User
Just in case someone else is looking to use them and doesn't know the codes.

Times change.
Keycodes has all the basics but there are codes as defines in a lot of my programs that are not in keycodes.
Pretty much shouldn't all the available codes be in there not just the basic ones.
 
Upvote 0

drgottjr

Expert
Licensed User
Longtime User
you get your keycodes class into the core library by
rebuilding the core library and substituting your class
for the original in the build. (technically, you could
extend the core key codes class with your new codes,
but you would have to modify the activity wrapper to
use your class instead of the core class. the same
would be true for any other b4a wrapper or class that
might use the core's key codes. b4a's documentation
only refers to activity touches.)

how were you planning on using the new codes?
b4a has one class (discussed above), android has a
different class of key codes. were you looking to
override something at the os level?

you can always formulate a wish to have your codes
included in the next core build.
 
Upvote 0

Robert Valentino

Well-Known Member
Licensed User
Longtime User
I have my own keypad that pops up to let users type in scores.
On all devices that have a physical keyboard the number keys work fine.
This Chromebook has an actual number keypad and it returns different values KEYCODE_NUMPAD_0 ... KEYCODE_NUMPAD_9 instead of the KEYCODE_0 ... KEYCODE_9
 
Upvote 0

drgottjr

Expert
Licensed User
Longtime User
chromebook doesn't use android. not sure what modifying b4a's core lib gets you, but i'd say if chromebook is running android in a vm to allow android apps to work, it's probably using going with how android might handle a hardware keypad, however that might be. in any case, android uses a different set of keycodes for edittext input than b4a's core key codes.
 
Last edited:
Upvote 0

drgottjr

Expert
Licensed User
Longtime User
we seem to have drifted away from your original questions (which have been answered). you win.
 
Upvote 0
Top