Hi!

I am using VS and C# to create an application in which I want the user to be
able to type swedish characters with the hardware keyboard. Since the
keyboard doesn't have any of those keys I was hoping to produce the swedish
characters from my code after I receive a certain key value from the user.

I am using keybd_event from coredll.dll but I don't understand how I can
produce a character of my own liking. I can't find the swedish characters
(or any other special chars) in the list below of virtual keys codes.

keybd_event(byte bVk, byte bScan, int dwFlags, int dwExtraInfo):
[http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wceui40/ht
ml/cerefKeybd_event.asp]
Virtual Key Codes:
[http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wceui40/ht
ml/cerefvirtualkeycodes.asp]

Is the key codes in the list above the only chars that can be synthezised
with the keybd_event method? Is there another method that can be used to
send more general (ASCII, Unicode) chars???

regards,

Peter

Re: Virtual-Key Codes for swedish chars å,ä and ö by éric

éric
Wed Feb 25 08:24:05 CST 2004

Are there not third party keyboards that type International characters?
this might be an option

http://ectaco.com/software/item.php3?refid=0&rfr_id=1&rqt_id=2&pagelang=23&lang=19&softid=306&scat=7
or
http://swedish.pocket-pc.penreader.com/Language_Extender_Swedish.html

éric

"Peter B" <peter@data.se> wrote in message
news:OsUif75%23DHA.268@TK2MSFTNGP10.phx.gbl...
> Hi!
>
> I am using VS and C# to create an application in which I want the user to
be
> able to type swedish characters with the hardware keyboard. Since the
> keyboard doesn't have any of those keys I was hoping to produce the
swedish
> characters from my code after I receive a certain key value from the user.
>
> I am using keybd_event from coredll.dll but I don't understand how I can
> produce a character of my own liking. I can't find the swedish characters
> (or any other special chars) in the list below of virtual keys codes.
>
> keybd_event(byte bVk, byte bScan, int dwFlags, int dwExtraInfo):
>
[http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wceui40/ht
> ml/cerefKeybd_event.asp]
> Virtual Key Codes:
>
[http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wceui40/ht
> ml/cerefvirtualkeycodes.asp]
>
> Is the key codes in the list above the only chars that can be synthezised
> with the keybd_event method? Is there another method that can be used to
> send more general (ASCII, Unicode) chars???
>
> regards,
>
> Peter
>
>



Re: Virtual-Key Codes for swedish chars å,ä and ö by Peter

Peter
Wed Feb 25 08:49:51 CST 2004

You may have missed the line "...hardware keyboard..." :)

I am not talking about the SIP, but as it can produce national chars I am
sure I could from my code :) Maybe I could use the api's behind the SIP?

/ P

"éric" <eric@westgen.com> wrote in message
news:O3mxIs6%23DHA.3668@TK2MSFTNGP09.phx.gbl...
> Are there not third party keyboards that type International characters?
> this might be an option
>
>
http://ectaco.com/software/item.php3?refid=0&rfr_id=1&rqt_id=2&pagelang=23&lang=19&softid=306&scat=7
> or
> http://swedish.pocket-pc.penreader.com/Language_Extender_Swedish.html
>
> éric
>
> "Peter B" <peter@data.se> wrote in message
> news:OsUif75%23DHA.268@TK2MSFTNGP10.phx.gbl...
> > Hi!
> >
> > I am using VS and C# to create an application in which I want the user
to
> be
> > able to type swedish characters with the hardware keyboard. Since the
> > keyboard doesn't have any of those keys I was hoping to produce the
> swedish
> > characters from my code after I receive a certain key value from the
user.
> >
> > I am using keybd_event from coredll.dll but I don't understand how I can
> > produce a character of my own liking. I can't find the swedish
characters
> > (or any other special chars) in the list below of virtual keys codes.
> >
> > keybd_event(byte bVk, byte bScan, int dwFlags, int dwExtraInfo):
> >
>
[http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wceui40/ht
> > ml/cerefKeybd_event.asp]
> > Virtual Key Codes:
> >
>
[http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wceui40/ht
> > ml/cerefvirtualkeycodes.asp]
> >
> > Is the key codes in the list above the only chars that can be
synthezised
> > with the keybd_event method? Is there another method that can be used to
> > send more general (ASCII, Unicode) chars???
> >
> > regards,
> >
> > Peter
> >
> >
>
>



Re: Virtual-Key Codes for swedish chars å,ä and ö by Paul

Paul
Wed Feb 25 09:14:53 CST 2004

Peter,

I've not done it this way (I've always modified the keyboard driver), but
you should be able to generate a given key code with Alt+<#>+<#>+<#>, as
long as the character is in the ASCII code range, which I think those are.
This is the equivalent of holding down the Alt key and pressing the number
keys on the numeric keypad to generate a code. You'll need to make sure
that the characters that you send are in the right order (Alt goes down,
then numeric keypad first number down, then up, etc., finally Alt goes up).

Alternatively, you may be able to use PostKeybdMessage() to send the Unicode
key directly, but I think that, without the keyboard driver knowing about
Swedish, that probably won't work. There are a lot of little things that
you can try with it, though, so maybe I'm wrong about that.

Paul T.

"Peter B" <peter@data.se> wrote in message
news:OPHs166%23DHA.2660@TK2MSFTNGP10.phx.gbl...
> You may have missed the line "...hardware keyboard..." :)
>
> I am not talking about the SIP, but as it can produce national chars I am
> sure I could from my code :) Maybe I could use the api's behind the SIP?
>
> / P
>
> "éric" <eric@westgen.com> wrote in message
> news:O3mxIs6%23DHA.3668@TK2MSFTNGP09.phx.gbl...
> > Are there not third party keyboards that type International characters?
> > this might be an option
> >
> >
>
http://ectaco.com/software/item.php3?refid=0&rfr_id=1&rqt_id=2&pagelang=23&lang=19&softid=306&scat=7
> > or
> > http://swedish.pocket-pc.penreader.com/Language_Extender_Swedish.html
> >
> > éric
> >
> > "Peter B" <peter@data.se> wrote in message
> > news:OsUif75%23DHA.268@TK2MSFTNGP10.phx.gbl...
> > > Hi!
> > >
> > > I am using VS and C# to create an application in which I want the user
> to
> > be
> > > able to type swedish characters with the hardware keyboard. Since the
> > > keyboard doesn't have any of those keys I was hoping to produce the
> > swedish
> > > characters from my code after I receive a certain key value from the
> user.
> > >
> > > I am using keybd_event from coredll.dll but I don't understand how I
can
> > > produce a character of my own liking. I can't find the swedish
> characters
> > > (or any other special chars) in the list below of virtual keys codes.
> > >
> > > keybd_event(byte bVk, byte bScan, int dwFlags, int dwExtraInfo):
> > >
> >
>
[http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wceui40/ht
> > > ml/cerefKeybd_event.asp]
> > > Virtual Key Codes:
> > >
> >
>
[http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wceui40/ht
> > > ml/cerefvirtualkeycodes.asp]
> > >
> > > Is the key codes in the list above the only chars that can be
> synthezised
> > > with the keybd_event method? Is there another method that can be used
to
> > > send more general (ASCII, Unicode) chars???
> > >
> > > regards,
> > >
> > > Peter
> > >
> > >
> >
> >
>
>



Re: Virtual-Key Codes for swedish chars å,ä and ö by éric

éric
Wed Feb 25 10:32:04 CST 2004

hardware keyboard..." :)

sorry... I missed that!
but yeah if they can do you should to!!! <-- not much help but a few words
of encouragement

Regards,

éric

"Peter B" <peter@data.se> wrote in message
news:OPHs166%23DHA.2660@TK2MSFTNGP10.phx.gbl...
> You may have missed the line "...hardware keyboard..." :)
>
> I am not talking about the SIP, but as it can produce national chars I am
> sure I could from my code :) Maybe I could use the api's behind the SIP?
>
> / P
>
> "éric" <eric@westgen.com> wrote in message
> news:O3mxIs6%23DHA.3668@TK2MSFTNGP09.phx.gbl...
> > Are there not third party keyboards that type International characters?
> > this might be an option
> >
> >
>
http://ectaco.com/software/item.php3?refid=0&rfr_id=1&rqt_id=2&pagelang=23&lang=19&softid=306&scat=7
> > or
> > http://swedish.pocket-pc.penreader.com/Language_Extender_Swedish.html
> >
> > éric
> >
> > "Peter B" <peter@data.se> wrote in message
> > news:OsUif75%23DHA.268@TK2MSFTNGP10.phx.gbl...
> > > Hi!
> > >
> > > I am using VS and C# to create an application in which I want the user
> to
> > be
> > > able to type swedish characters with the hardware keyboard. Since the
> > > keyboard doesn't have any of those keys I was hoping to produce the
> > swedish
> > > characters from my code after I receive a certain key value from the
> user.
> > >
> > > I am using keybd_event from coredll.dll but I don't understand how I
can
> > > produce a character of my own liking. I can't find the swedish
> characters
> > > (or any other special chars) in the list below of virtual keys codes.
> > >
> > > keybd_event(byte bVk, byte bScan, int dwFlags, int dwExtraInfo):
> > >
> >
>
[http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wceui40/ht
> > > ml/cerefKeybd_event.asp]
> > > Virtual Key Codes:
> > >
> >
>
[http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wceui40/ht
> > > ml/cerefvirtualkeycodes.asp]
> > >
> > > Is the key codes in the list above the only chars that can be
> synthezised
> > > with the keybd_event method? Is there another method that can be used
to
> > > send more general (ASCII, Unicode) chars???
> > >
> > > regards,
> > >
> > > Peter
> > >
> > >
> >
> >
>
>



Re: Virtual-Key Codes for swedish chars å,ä and ö by Peter

Peter
Wed Feb 25 11:19:44 CST 2004

Hi Toby, thanks for your help!

As it seems, Alt+1+3+4, which should return the swedish char å, only returns
a square symbol. So generating the special chars directly from the keyboard
doesn't seem to work. But I don't think that is what you suggested. I will
investigate how you send the "Alt-down, NUM1-d/u, NUM2-d/u, NUM3-d/u,
Alt-up"-sequence with the keybd_event-method, as it is now I have no idea
how to do that :)

The keyboard-driver shouldn't matter in this case. I mean, I am getting a
key event of any sort (for example "Ctrl + A" to simulate Å), and after
checking that I have a text-control in focus, send some sort of signal
(using keybd_event or any other method??) to create the swedish char (just
like the SIP does ). Thinking about it, it shouldn't be too hard, just have
to find the correct method, or?

regards,

Peter



"Paul G. Tobey [eMVP]" <ptobey_no_spam@instrument_no_spam.com> wrote in
message news:OyR6fI7%23DHA.552@TK2MSFTNGP11.phx.gbl...
> Peter,
>
> I've not done it this way (I've always modified the keyboard driver), but
> you should be able to generate a given key code with Alt+<#>+<#>+<#>, as
> long as the character is in the ASCII code range, which I think those are.
> This is the equivalent of holding down the Alt key and pressing the number
> keys on the numeric keypad to generate a code. You'll need to make sure
> that the characters that you send are in the right order (Alt goes down,
> then numeric keypad first number down, then up, etc., finally Alt goes
up).
>
> Alternatively, you may be able to use PostKeybdMessage() to send the
Unicode
> key directly, but I think that, without the keyboard driver knowing about
> Swedish, that probably won't work. There are a lot of little things that
> you can try with it, though, so maybe I'm wrong about that.
>
> Paul T.
>
> "Peter B" <peter@data.se> wrote in message
> news:OPHs166%23DHA.2660@TK2MSFTNGP10.phx.gbl...
> > You may have missed the line "...hardware keyboard..." :)
> >
> > I am not talking about the SIP, but as it can produce national chars I
am
> > sure I could from my code :) Maybe I could use the api's behind the SIP?
> >
> > / P
> >
> > "éric" <eric@westgen.com> wrote in message
> > news:O3mxIs6%23DHA.3668@TK2MSFTNGP09.phx.gbl...
> > > Are there not third party keyboards that type International
characters?
> > > this might be an option
> > >
> > >
> >
>
http://ectaco.com/software/item.php3?refid=0&rfr_id=1&rqt_id=2&pagelang=23&lang=19&softid=306&scat=7
> > > or
> > > http://swedish.pocket-pc.penreader.com/Language_Extender_Swedish.html
> > >
> > > éric
> > >
> > > "Peter B" <peter@data.se> wrote in message
> > > news:OsUif75%23DHA.268@TK2MSFTNGP10.phx.gbl...
> > > > Hi!
> > > >
> > > > I am using VS and C# to create an application in which I want the
user
> > to
> > > be
> > > > able to type swedish characters with the hardware keyboard. Since
the
> > > > keyboard doesn't have any of those keys I was hoping to produce the
> > > swedish
> > > > characters from my code after I receive a certain key value from the
> > user.
> > > >
> > > > I am using keybd_event from coredll.dll but I don't understand how I
> can
> > > > produce a character of my own liking. I can't find the swedish
> > characters
> > > > (or any other special chars) in the list below of virtual keys
codes.
> > > >
> > > > keybd_event(byte bVk, byte bScan, int dwFlags, int dwExtraInfo):
> > > >
> > >
> >
>
[http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wceui40/ht
> > > > ml/cerefKeybd_event.asp]
> > > > Virtual Key Codes:
> > > >
> > >
> >
>
[http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wceui40/ht
> > > > ml/cerefvirtualkeycodes.asp]
> > > >
> > > > Is the key codes in the list above the only chars that can be
> > synthezised
> > > > with the keybd_event method? Is there another method that can be
used
> to
> > > > send more general (ASCII, Unicode) chars???
> > > >
> > > > regards,
> > > >
> > > > Peter
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Re: Virtual-Key Codes for swedish chars å,ä and ö by Paul

Paul
Wed Feb 25 12:11:04 CST 2004

It depends on what is being sent. The process of converting a scan code to
the actual character that is to be returned *is* handled by the keyboard
driver. I don't know what will happen if you generate a scan code that is
not in the list that the driver knows about, for example.

The SIP is a special case. I guess that you might be able to figure out
what the SIP code does when you return a character to it and try to do the
same thing...

Paul T.

"Peter B" <peter@data.se> wrote in message
news:ekdbmO8%23DHA.3120@TK2MSFTNGP11.phx.gbl...
> Hi Toby, thanks for your help!
>
> As it seems, Alt+1+3+4, which should return the swedish char å, only
returns
> a square symbol. So generating the special chars directly from the
keyboard
> doesn't seem to work. But I don't think that is what you suggested. I will
> investigate how you send the "Alt-down, NUM1-d/u, NUM2-d/u, NUM3-d/u,
> Alt-up"-sequence with the keybd_event-method, as it is now I have no idea
> how to do that :)
>
> The keyboard-driver shouldn't matter in this case. I mean, I am getting a
> key event of any sort (for example "Ctrl + A" to simulate Å), and after
> checking that I have a text-control in focus, send some sort of signal
> (using keybd_event or any other method??) to create the swedish char (just
> like the SIP does ). Thinking about it, it shouldn't be too hard, just
have
> to find the correct method, or?
>
> regards,
>
> Peter
>
>
>
> "Paul G. Tobey [eMVP]" <ptobey_no_spam@instrument_no_spam.com> wrote in
> message news:OyR6fI7%23DHA.552@TK2MSFTNGP11.phx.gbl...
> > Peter,
> >
> > I've not done it this way (I've always modified the keyboard driver),
but
> > you should be able to generate a given key code with Alt+<#>+<#>+<#>, as
> > long as the character is in the ASCII code range, which I think those
are.
> > This is the equivalent of holding down the Alt key and pressing the
number
> > keys on the numeric keypad to generate a code. You'll need to make sure
> > that the characters that you send are in the right order (Alt goes down,
> > then numeric keypad first number down, then up, etc., finally Alt goes
> up).
> >
> > Alternatively, you may be able to use PostKeybdMessage() to send the
> Unicode
> > key directly, but I think that, without the keyboard driver knowing
about
> > Swedish, that probably won't work. There are a lot of little things
that
> > you can try with it, though, so maybe I'm wrong about that.
> >
> > Paul T.
> >
> > "Peter B" <peter@data.se> wrote in message
> > news:OPHs166%23DHA.2660@TK2MSFTNGP10.phx.gbl...
> > > You may have missed the line "...hardware keyboard..." :)
> > >
> > > I am not talking about the SIP, but as it can produce national chars I
> am
> > > sure I could from my code :) Maybe I could use the api's behind the
SIP?
> > >
> > > / P
> > >
> > > "éric" <eric@westgen.com> wrote in message
> > > news:O3mxIs6%23DHA.3668@TK2MSFTNGP09.phx.gbl...
> > > > Are there not third party keyboards that type International
> characters?
> > > > this might be an option
> > > >
> > > >
> > >
> >
>
http://ectaco.com/software/item.php3?refid=0&rfr_id=1&rqt_id=2&pagelang=23&lang=19&softid=306&scat=7
> > > > or
> > > >
http://swedish.pocket-pc.penreader.com/Language_Extender_Swedish.html
> > > >
> > > > éric
> > > >
> > > > "Peter B" <peter@data.se> wrote in message
> > > > news:OsUif75%23DHA.268@TK2MSFTNGP10.phx.gbl...
> > > > > Hi!
> > > > >
> > > > > I am using VS and C# to create an application in which I want the
> user
> > > to
> > > > be
> > > > > able to type swedish characters with the hardware keyboard. Since
> the
> > > > > keyboard doesn't have any of those keys I was hoping to produce
the
> > > > swedish
> > > > > characters from my code after I receive a certain key value from
the
> > > user.
> > > > >
> > > > > I am using keybd_event from coredll.dll but I don't understand how
I
> > can
> > > > > produce a character of my own liking. I can't find the swedish
> > > characters
> > > > > (or any other special chars) in the list below of virtual keys
> codes.
> > > > >
> > > > > keybd_event(byte bVk, byte bScan, int dwFlags, int dwExtraInfo):
> > > > >
> > > >
> > >
> >
>
[http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wceui40/ht
> > > > > ml/cerefKeybd_event.asp]
> > > > > Virtual Key Codes:
> > > > >
> > > >
> > >
> >
>
[http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wceui40/ht
> > > > > ml/cerefvirtualkeycodes.asp]
> > > > >
> > > > > Is the key codes in the list above the only chars that can be
> > > synthezised
> > > > > with the keybd_event method? Is there another method that can be
> used
> > to
> > > > > send more general (ASCII, Unicode) chars???
> > > > >
> > > > > regards,
> > > > >
> > > > > Peter
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Re: Virtual-Key Codes for swedish chars å,ä and ö by Peter

Peter
Thu Feb 26 02:15:46 CST 2004

Oh dear, have I been complicating things slightly here :-)

I realized that all I need to do is append the special character to the
controls text property, I don't need to send any keyboard-events :-) Since
the Ctrl_KeyDown event handler gives me the sender control, I can simply add
the char to it's text.

Instead I am trying to find out how to determine if the control is editable,
i.e. a control that can receive input text such as textbox and combobox. The
keydown event handler handles events from all different controls, and I
don't want to send the char to a buttons or forms text property :-)

/ Peter


"Paul G. Tobey [eMVP]" <ptobey_no_spam@instrument_no_spam.com> wrote in
message news:ermh8q8%23DHA.4012@tk2msftngp13.phx.gbl...
> It depends on what is being sent. The process of converting a scan code
to
> the actual character that is to be returned *is* handled by the keyboard
> driver. I don't know what will happen if you generate a scan code that is
> not in the list that the driver knows about, for example.
>
> The SIP is a special case. I guess that you might be able to figure out
> what the SIP code does when you return a character to it and try to do the
> same thing...
>
> Paul T.
>
> "Peter B" <peter@data.se> wrote in message
> news:ekdbmO8%23DHA.3120@TK2MSFTNGP11.phx.gbl...
> > Hi Toby, thanks for your help!
> >
> > As it seems, Alt+1+3+4, which should return the swedish char å, only
> returns
> > a square symbol. So generating the special chars directly from the
> keyboard
> > doesn't seem to work. But I don't think that is what you suggested. I
will
> > investigate how you send the "Alt-down, NUM1-d/u, NUM2-d/u, NUM3-d/u,
> > Alt-up"-sequence with the keybd_event-method, as it is now I have no
idea
> > how to do that :)
> >
> > The keyboard-driver shouldn't matter in this case. I mean, I am getting
a
> > key event of any sort (for example "Ctrl + A" to simulate Å), and after
> > checking that I have a text-control in focus, send some sort of signal
> > (using keybd_event or any other method??) to create the swedish char
(just
> > like the SIP does ). Thinking about it, it shouldn't be too hard, just
> have
> > to find the correct method, or?
> >
> > regards,
> >
> > Peter
> >
> >
> >
> > "Paul G. Tobey [eMVP]" <ptobey_no_spam@instrument_no_spam.com> wrote in
> > message news:OyR6fI7%23DHA.552@TK2MSFTNGP11.phx.gbl...
> > > Peter,
> > >
> > > I've not done it this way (I've always modified the keyboard driver),
> but
> > > you should be able to generate a given key code with Alt+<#>+<#>+<#>,
as
> > > long as the character is in the ASCII code range, which I think those
> are.
> > > This is the equivalent of holding down the Alt key and pressing the
> number
> > > keys on the numeric keypad to generate a code. You'll need to make
sure
> > > that the characters that you send are in the right order (Alt goes
down,
> > > then numeric keypad first number down, then up, etc., finally Alt goes
> > up).
> > >
> > > Alternatively, you may be able to use PostKeybdMessage() to send the
> > Unicode
> > > key directly, but I think that, without the keyboard driver knowing
> about
> > > Swedish, that probably won't work. There are a lot of little things
> that
> > > you can try with it, though, so maybe I'm wrong about that.
> > >
> > > Paul T.
> > >
> > > "Peter B" <peter@data.se> wrote in message
> > > news:OPHs166%23DHA.2660@TK2MSFTNGP10.phx.gbl...
> > > > You may have missed the line "...hardware keyboard..." :)
> > > >
> > > > I am not talking about the SIP, but as it can produce national chars
I
> > am
> > > > sure I could from my code :) Maybe I could use the api's behind the
> SIP?
> > > >
> > > > / P
> > > >
> > > > "éric" <eric@westgen.com> wrote in message
> > > > news:O3mxIs6%23DHA.3668@TK2MSFTNGP09.phx.gbl...
> > > > > Are there not third party keyboards that type International
> > characters?
> > > > > this might be an option
> > > > >
> > > > >
> > > >
> > >
> >
>
http://ectaco.com/software/item.php3?refid=0&rfr_id=1&rqt_id=2&pagelang=23&lang=19&softid=306&scat=7
> > > > > or
> > > > >
> http://swedish.pocket-pc.penreader.com/Language_Extender_Swedish.html
> > > > >
> > > > > éric
> > > > >
> > > > > "Peter B" <peter@data.se> wrote in message
> > > > > news:OsUif75%23DHA.268@TK2MSFTNGP10.phx.gbl...
> > > > > > Hi!
> > > > > >
> > > > > > I am using VS and C# to create an application in which I want
the
> > user
> > > > to
> > > > > be
> > > > > > able to type swedish characters with the hardware keyboard.
Since
> > the
> > > > > > keyboard doesn't have any of those keys I was hoping to produce
> the
> > > > > swedish
> > > > > > characters from my code after I receive a certain key value from
> the
> > > > user.
> > > > > >
> > > > > > I am using keybd_event from coredll.dll but I don't understand
how
> I
> > > can
> > > > > > produce a character of my own liking. I can't find the swedish
> > > > characters
> > > > > > (or any other special chars) in the list below of virtual keys
> > codes.
> > > > > >
> > > > > > keybd_event(byte bVk, byte bScan, int dwFlags, int dwExtraInfo):
> > > > > >
> > > > >
> > > >
> > >
> >
>
[http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wceui40/ht
> > > > > > ml/cerefKeybd_event.asp]
> > > > > > Virtual Key Codes:
> > > > > >
> > > > >
> > > >
> > >
> >
>
[http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wceui40/ht
> > > > > > ml/cerefvirtualkeycodes.asp]
> > > > > >
> > > > > > Is the key codes in the list above the only chars that can be
> > > > synthezised
> > > > > > with the keybd_event method? Is there another method that can be
> > used
> > > to
> > > > > > send more general (ASCII, Unicode) chars???
> > > > > >
> > > > > > regards,
> > > > > >
> > > > > > Peter
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Re: Virtual-Key Codes for swedish chars å,ä and ö by Peter

Peter
Thu Feb 26 07:30:24 CST 2004

Here's the code I use if anyone is interested. This examples waits for
keydown of key F9, this can of course be changed to a key or key-combination
of your liking. Are there any complications with using key_down?


private void textBox1_KeyDown(object sender,
System.Windows.Forms.KeyEventArgs e)
{
switch (e.KeyCode)
{
case Keys.F9: // Swedish Ö
// Check if this is an input-control
if( sender is TextBox )
{
TextBox tBox = (TextBox)sender;
int pos = tBox.SelectionStart;
// Must position at correct place..
if( e.Shift )
{
tBox.Text = tBox.Text.Insert(
tBox.SelectionStart,
"Ö" );
tBox.SelectionStart = pos + 1;
}
else
{
tBox.Text = tBox.Text.Insert(
tBox.SelectionStart,
"ö" );
tBox.SelectionStart = pos + 1;
}
}
else if( sender is ComboBox )
{
// Highlight items starting with ö or Ö
}
break;
default:
break;
}
}

best regards,

Peter