R
Robert Barreiro
Hi everyone!
I'm developing a custom control for Windows Mobile which mimics the SIP
built-in keyboard, basically it's the same, but the difference is that I
need to be able to move it, displaying the keyboard on the bottom of the
screen, top, etc.
I'm using the PostKeybdMessage function to send the user selected key to the
active window, that's simple. But I have a problem: I can't send the arrows
keys (up, down, right, left). The codes are:
- Up: 38
- Down: 40
- Left: 37
- Right: 39
But these are the same codes for other characters, so when I'm sending that
codes I get the character representation (38=& - 39=( - 37=% - 39='). The
question is, what I'm doing wrong? Do I have to send another code too?
The code snippet I'm using for the SendKey function is something like this:
private void SendKey(byte key) {
uint KeyStateDownFlag = 0x0080;
uint KeyShiftDeadFlag = 0x20000;
uint[] buf1 = new uint[1];
uint[] DownStates = new uint[1];
DownStates[0]=KeyStateDownFlag;
buf1[0]=(uint)key;
uint[] DeadStates = {KeyShiftDeadFlag};
int hwnd = -1;
PostKeybdMessage(hwnd, 0, KeyStateDownFlag, (uint)buf1.Length,
DownStates, buf1);
}
I really appreciate your help, I'm kind of stuck with this
Regards,
Robert Barreiro.
I'm developing a custom control for Windows Mobile which mimics the SIP
built-in keyboard, basically it's the same, but the difference is that I
need to be able to move it, displaying the keyboard on the bottom of the
screen, top, etc.
I'm using the PostKeybdMessage function to send the user selected key to the
active window, that's simple. But I have a problem: I can't send the arrows
keys (up, down, right, left). The codes are:
- Up: 38
- Down: 40
- Left: 37
- Right: 39
But these are the same codes for other characters, so when I'm sending that
codes I get the character representation (38=& - 39=( - 37=% - 39='). The
question is, what I'm doing wrong? Do I have to send another code too?
The code snippet I'm using for the SendKey function is something like this:
private void SendKey(byte key) {
uint KeyStateDownFlag = 0x0080;
uint KeyShiftDeadFlag = 0x20000;
uint[] buf1 = new uint[1];
uint[] DownStates = new uint[1];
DownStates[0]=KeyStateDownFlag;
buf1[0]=(uint)key;
uint[] DeadStates = {KeyShiftDeadFlag};
int hwnd = -1;
PostKeybdMessage(hwnd, 0, KeyStateDownFlag, (uint)buf1.Length,
DownStates, buf1);
}
I really appreciate your help, I'm kind of stuck with this
Regards,
Robert Barreiro.