Qwerty keyboard codes

  • Thread starter Thread starter farseer
  • Start date Start date
F

farseer

Hi,
i have a pocket PC with a qwerty keyboard.
i'd like to know how to detect characters like the "@" and "^" symbols.
currently i have a message handler (using MessageWindow) that handles
keys that i register using RegisterHotKeys. I have registered keys
from -20 to 500 to try and determine most keys. but apparently, i am
unable to detect certain characters accessible from the alternate key,
tese include "@", "^", "/", "#", "~", "&", "%", "_",":", "(", ")", "!",
"," and double quotes. alother characters (including the remaining
alternate keys) i am able to detect and process.

thank you
 
Why would you be doing things that way? That seems like an incredibly
over-complex method of doing it. Why not just detect all key events as they
arrive and look at the key? The ApplicationEx class from OpenNETCF, with a
suitable IMessageFilter, should do that for you.

RegisterHotKey should detect things that come through as shifted versions of
other characters by detecting the unshifted version of the character with
the shift key down. So, on a US keyboard, Shift+2 is @...

Paul T.
 
-i am trying to simulate some states that the phone apparently does not
implement...for instance a lock for alternate state. currently, you
have to press the alt button each time you want to type an alternate
character.
so to simulate a lock, i will need to detect keys, and send the
alternate key if "alternate lock" state is on.
-also, ApplicationEx seems to be application specific...i need to
handle keys "globally", at the device level so to speak.
-what i have right now is working for most keys, however, i am unable
to determine what the codes for the characters mentioned above are, so
i am unable to use RegisterHotKeys on them.
 
Well, the only way to completely take over key generation is to be the
keyboard driver, which you probably aren't going to be able to do. I think
that you're out of luck, except on an application-by-application basis,
where you can use ApplicationEx and do whatever you'd like.

I covered how to trap the indicated keys with RegisterHotKey. Please read
the message.

Paul T.
 
yes, i read your message, thank you. i have been using RegisterHotKeys
(as mentioned in my original post) sucessfully to trap most of the keys
on a global basis (not application by application). alas, not all keys
seem trappable by that method, or by using a low level keyboard
hook...*sigh*
 
Did you *try* the method I indicated for trapping the specified keys, like
@, with RegisterHotKey?

"RegisterHotKey should detect things that come through as shifted versions
of
other characters by detecting the unshifted version of the character with
the shift key down. So, on a US keyboard, Shift+2 is @..."

Paul T.
 
ok, i did not try that. my fault, should have read your response more
carefully. my appologies.
i will try it, though i know pressing shift+2 on a qwerty does not
yield the @ symbol, but perhaps as you state, i will still come thru
like that.
 
On my PC keyboard, Shift+2 certainly *does* give an @. This also works on
our devices which use a keypad, not a standard PS/2 keyboard, but which use
the US keyboard layout, basically.

Maybe what you mean by a Qwerty keyboard is something else. More specific
information gets better responses.

Paul T.
 
the querty keyboard i am referring to is the one on my mobile phone/pda
device (sorry for any confusion, i am used to referring to keyboards
for compact devices as "qwerty", since that is how many manufacturers
of those devices advertise them). it does not match a US-101 keyboard.
it's specifically for compact device and this one is a 37 key
keyboard, so key buttons are "overloaded". in my case, to get the @
symbol, i click the "FN" key then the "Q" key. the FN key comes thru
as keycode 144, but nothing for the @ symbol. However, if i wanted to
type a "1", i would press FN and then press the "W" key. there, the
correct code (47 i think) comes thru.
 
As I mentioned before, the keyboard driver is responsible for mapping keys,
so it's quite possible that you'll never be able to capture those keys.
Have you tried it for @?

Paul T.
 
not yet,
got a new system today and will take a day or two to move everything
over, including all my projects (in between, i have been posting using
my phone/pocket pc). i will try your suggestion and be sure to let you
know.

one follow up question: i understand the keyboard driver is responsible
for mapping keys. But ,if i am unable to detect these at all after
trying your suggestion, it would probably mean that the driver is not
sending key up and key down messages for these keys, correct? if so,
then it would seem that no application would be able to process these
special characters...that would be considered a bug in the driver, no?
 
It means that how it is sending the characters doesn't involve duplicating
the keystrokes that an ordinary keyboard layout would use. It doesn't have
to do that. You can imagine a keyboard with exactly one key for every
character and it would be perfectly OK for it not to generate the same set
of keyboard operations as is needed on a keyboard where you have to generate
shift+2 to get @, for example. It would not be a bug; it just wouldn't be
compatible with how you want to do things.

Paul T.
 
Back
Top