B4J Question Underscore character

rspitzer

Active Member
I am displaying a keyboard layout for an operator. So far every key is working and tested except got the underscore key. This is the code I am using for the underscore key:

B4X:
    robot.RunMethod("keyPress", Array(KeyCode.GetField("SHIFT")))
    robot.RunMethod("keyPress", Array(KeyCode.GetField("UNDERSCORE")))
    robot.RunMethod("keyRelease", Array(KeyCode.GetField("UNDERSCORE")))
    robot.RunMethod("keyRelease", Array(KeyCode.GetField("SHIFT")))

The SHIFT works, I have tested that separately, lower case keys become upper case.
I can step through the code and I don't get a java type reference error.
The java docs on key codes say that the "_" is called UNDERSCORE, so its not the end of the world here, but I am curious if someone has an answer about this?
 
Last edited:
Top