button press events

Is there a list of all possible keyboard button press events, other than what I can infer from includes/keyboardButton.h? I’d like to be able to use some text input, but I can’t receive events for any capital letters; Panda won’t even give me a shift key event followed by the lowercase letter. Am I not aware of the right event to request, or is this an actual limitation of the system?

By default, Panda treats the shift, control, and alt keys as modifier buttons: these are tracked specifically, and when they are pressed in conjunction with another key, for instance the “a” key, you get the event “shift-a” (for instance). (You can turn this feature off, or add additional keys to the set of modifier buttons; but that’s another topic.)

To see the actual event names that are generated for any given button event, type the Python command:


messenger.toggleVerbose()

and then watch the events scroll by as you press buttons.

Note, however, that this button event system is designed for the purpose of using keys as control buttons. Thus, pressing shift-4 gives the event “shift-4”, and not “$”. With a bit of effort and a remapping table, it is possible to use this system for keyboard text input, but it’s clumsy, and it doesn’t work at all with international keyboards.

If you want to record what the user is typing, as opposed to what buttons he/she is pressing, it’s recommended that you use a DirectEntry. This has full support for capital letters, punctuation marks, and international characters, including “keystrokes” generated with (for instance) the Mandarin IME.

David

Thanks David, that’s exactly what I needed!