keybd_event_() and German umlauts

Windows specific forum
milan1612
Addict
Addict
Posts: 894
Joined: Thu Apr 05, 2007 12:15 am
Location: Nuremberg, Germany
Contact:

keybd_event_() and German umlauts

Post by milan1612 »

I can't find any information related to using keybd_event_() with German umlauts,
especially when not using the German keyboard layout (I got a UK keyboard yesterday).

(There are no virtual key codes for them)
There is the VK_PACKET constant, that allows to send unicode characters,
but I don't know how to use it and if it is appropriate for my problem...

Anybody?
Windows 7 & PureBasic 4.4
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post by Kaeru Gaman »

.... I would use GetAsyncKeystate and check for the "native" KeyValue ...

I think "[" and "]" are two of them...
oh... and have a nice day.
milan1612
Addict
Addict
Posts: 894
Joined: Thu Apr 05, 2007 12:15 am
Location: Nuremberg, Germany
Contact:

Post by milan1612 »

Kaeru Gaman wrote:.... I would use GetAsyncKeystate and check for the "native" KeyValue ...

I think "[" and "]" are two of them...
keybd_event() is to send keyboard input, not to retrieve it :wink:

As I read that keybd_event is outdated, I tried with the alternative SendInput():

Code: Select all

Procedure SendKey(chr)
  Protected Input.INPUT
  #KEYEVENTF_UNICODE = 4
  
  RtlZeroMemory_(@input, SizeOf(INPUT))
  Input\type = #INPUT_KEYBOARD
  Input\ki\wScan = chr
  input\ki\dwFlags = #KEYEVENTF_UNICODE
  
  SendInput_(1, @Input, SizeOf(INPUT))
  
  Input\type = #INPUT_KEYBOARD
  Input\ki\wScan = chr
  Input\ki\dwFlags = #KEYEVENTF_UNICODE | #KEYEVENTF_KEYUP
  
  SendInput_(1, @Input, SizeOf(INPUT))
EndProcedure 
And this seems to work with Umlauts :P
Windows 7 & PureBasic 4.4
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post by Kaeru Gaman »

keybd_event() is to send keyboard input, not to retrieve it
Oy! Image
I'm tho thorry...
oh... and have a nice day.
Post Reply