International Keyboard Input
-
Hello everyone, I'm wondering if there's a way to obtain user input without using a Form KeyDown event. I'm specifically looking for a method to get printable characters no matter which keyboard layout. I'm developing an user interface for a graphical engine and I'm coding a textbox from scratch. I'm currently using GetKeyboardState, MapVirtualKeyEx and ToAsciiEx from user32, but sometimes I get odd repeated characters and I have no means to tell the repeated characters from the actual input. Is there a managed way to get the same functionality? Thanks in advance, Rob
-
Hello everyone, I'm wondering if there's a way to obtain user input without using a Form KeyDown event. I'm specifically looking for a method to get printable characters no matter which keyboard layout. I'm developing an user interface for a graphical engine and I'm coding a textbox from scratch. I'm currently using GetKeyboardState, MapVirtualKeyEx and ToAsciiEx from user32, but sometimes I get odd repeated characters and I have no means to tell the repeated characters from the actual input. Is there a managed way to get the same functionality? Thanks in advance, Rob
Roberto Collina wrote:
if there's a way to obtain user input without using a Form KeyDown event
No, not without digging deep into the bios.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
-
Roberto Collina wrote:
if there's a way to obtain user input without using a Form KeyDown event
No, not without digging deep into the bios.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
Thank you for your reply. I'm sorry to hear since this is going to be problematic. I was pretty much sure I'd have eventually found a .net counterpart for the user32 methods I mentioned. I'm curious to know how user interface developers in the .net era address to this issue. After all, text input is a basic feature. Thanks again.
-
Thank you for your reply. I'm sorry to hear since this is going to be problematic. I was pretty much sure I'd have eventually found a .net counterpart for the user32 methods I mentioned. I'm curious to know how user interface developers in the .net era address to this issue. After all, text input is a basic feature. Thanks again.
Roberto Collina wrote:
I'm sorry to hear since this is going to be problematic.
I have always thought the OS takes care of any internationalization.
Roberto Collina wrote:
curious to know how user interface developers in the .net era address to this issue.
I wonder if there are any google groups that can shed light.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
-
Roberto Collina wrote:
I'm sorry to hear since this is going to be problematic.
I have always thought the OS takes care of any internationalization.
Roberto Collina wrote:
curious to know how user interface developers in the .net era address to this issue.
I wonder if there are any google groups that can shed light.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
Paul Conrad wrote:
I have always thought the OS takes care of any internationalization.
But it does. The scanToAscii method returns modifier-aware input. If you press shift and then a, you get "A". It's indeed very handy. My main problem is that it behaves oddily. So, to reiterate, I was wondering how this can be done in a managed way - I don't care if it eventually boils down to those user32 calls. I think WPF has an Input.Keyboard class somewhere, I was looking for something similar for previous .net versions. Still, thanks for your reply. I will check the google groups for info as well. Regards.