03-18-2023, 02:56 AM
(03-17-2023, 04:58 AM)Balderdash Wrote: Well, I wasn't reading Chinese keyboard input. I was reading files returned from dialogs. I imagine if I wrote a custom input routine, it would work. You'd just need to be able to display the characters you're taking in so you know what you're typing. Could be a fun challenge.
(03-17-2023, 06:11 AM)SMcNeill Wrote:(03-17-2023, 02:29 AM)NasaCow Wrote: I was wondering if you knew how to read input in Chinese from the keyboard, that would be very useful for me. I haven't been able to figure anything out. Displaying Chinese charaters is straight enough with QPrint (Uprint) with the proper font file that supports unicode. But I haven't been able to read anything from the keyboard... yet!
https://staging.qb64phoenix.com/showthread.php?tid=21 -- If you're using Windows, you can use my Keyhit library to read a chinese keyboard. You'd just have to configure it to map to the proper keys on the keyboard. I've never had any Chinese keyboard (and certainly don't know the language any at all), so I've never had a chance to work up a character mapping to any keyboard with their characters on it. In the library is mappings to European keyboards, German, Italian, and US Standard keyboards, so you could probably use those as a roadmap to help you set it to whatever you need it to map to.
This is beyond my technical knowledge. All computers will use the standard physical layout (US based I assume?) and there is a software input called input method engine (IME) that (I assume) translates the particular code to unicode so the computer knows which character to display for example when I am typing 我能打中文。it looks like this:
In a dos program in windows it looks like this:
Which means I can type Chinese. I know hardcoding into the IDE is out (since doesn't have a standard page?) but if the needed statements to print come from a text file and used with qprint (or uprint) then just comes down to taking a few extra steps to print text. (Time to make a cprint? hehe)
So, I believe is after a extended unicode (once again, I believe) is produced by the IME (see above as an example) is taken in by input (how would you even make a custom input command to start with? Do you read a keyboard buffer? Do I need all inputs be dumped to a file and then printed to the screen? Not sure what would work...) and if the extended-unicode (assuming I am right) can be preserved then there is nothing stopping a programmer to reprint it to the screen to display it. I would mind doing the grunt of programming if I understood it from a conceptual idea. I justs need to learn how the typing interface works with the OS or the program or.... Just spit balling here. Might just have to try and see what is produced!