Multilingua virtual keyboard

dotComex

New member
Joined
May 8, 2016
Messages
2
Programming Experience
1-3
Hello friends,

I'm working on a keyboard application for a small community. Their alphabets are as shown below.
Basically, the application will allow users to either type on the pc keyboard, or the virtual onScreen keys.
It should be noted that their alphabet do not have letter Q, F, X, Z and this will be replaced with Unicode chars.

I've managed to get the onScreen working using the SendKeys.send() method of C#.
However, I'm having trouble getting this working with keyboard input using KeyDown method.
When someone type Q, I wanted unicode character say "Ɣ" to appear, and not the letter "Q".
A partial part of my code is as below. The keyDown event doesn't seem to fire at all.

Appreciate any help please.

C#:
 protected override CreateParams CreateParams
          {
               get
               {
                    CreateParams param = base.CreateParams;
                    param.ExStyle |=0x08000000;
                    return param;
               }
          }
private void Form1_KeyDown(object sender, KeyEventArgs e)
          {
               switch (e.KeyCode)
               {
                    case Keys.Enter:
                        SendKeys.Send("A");
                         break;
                     //The rest of the code here.........
               }
          }

Majuscules
A?BCDDhE?
ƐƐ̱Ɛ̈GƔHIJ
KLMNŊNhNyO?ƆƆ̱PRTThUWY
Minuscules
a?bcddhe?
ɛɛ̱ɛ̈gɣhij
klmnŋnhnyo?ɔɔ̱prtthuwy

Ac0F96Oq5Bj2AAAAAElFTkSuQmCC
 
Last edited:
KeyDown is the wrong event. You should be handling KeyPress. KeyDown and KeyUp are about the keyboard keys and KeyPress is about the characters that those keys produce. In the KeyPress event handler, there is an e.KeyChar property that contains the Char generated by the keys being pressed. In older versions of .NET, that was read-only but it was later changed to read/write, so you can replace a particular character with a different one. Sound useful?
 
KeyDown is the wrong event. You should be handling KeyPress. KeyDown and KeyUp are about the keyboard keys and KeyPress is about the characters that those keys produce. In the KeyPress event handler, there is an e.KeyChar property that contains the Char generated by the keys being pressed. In older versions of .NET, that was read-only but it was later changed to read/write, so you can replace a particular character with a different one. Sound useful?

Thanks so much for your response.

I have done that, but it does not send anything to ms word.

However, it puts "QƔ" on a textbox on the form when I pressed the Q key.

I wanted the greek letter "Ɣ" to display on ms word, notepad etc.

Please help.

Thanks.


C#:
private void keyPressedEvent(object sender, KeyPressEventArgs e)
          {
               switch (e.KeyChar)
               {
                    case 'Q':
                         SendKeys.Send("Ɣ");
                         //textBox1.Text = " MessageBox.Show(Key is Enter)";
                         break;
               }
          }
 
Back
Top Bottom