Hello Everyone!
I’ve been working on a custom GUI for my projects and I need to be able to
allow
user text input. I’ve been having some issues with getting this to work
correctly.
The most common solution is to enable Unicode and to cast
event.key.keysym.unicode as a char and add it to the string (char *).
That’s
all well and good if I want to use unicode.
If I do not, the only solution I found was to use iscntrl on the sym. If it
isn’t a control, then cast the sym as a char and add it.
However, when running some tests on the latest ubuntu I was getting odd
results
when using the keypad. Some where controls, some where special characters
(showed up as blocks)
What would be the best, most crossplatform compliant method of converting
keysyms to ANSII chars?
Would a large switch, enable unicode, or the use of iscntrl, or some other
method be best?
Performance is important, but stability and correct character reporting
would be
most important.
Thanks in advance!
- Micah Brening