Is it possible to get a character after pressing "Shift" without pressing shift?

Is it possible to get the character if "Shift" is pressed, that is, if I press "1", I get the character "1", but if I hold down "Shift", it becomes "!". - all without quotes, of course. How to do something like this programmatically?

There was a method in which you could just add ASCII code. However, this parameter is not suitable, since it will not work in each locale.

Is there an option that will work in .NET and, possibly, in Silverlight, where I can pass a character like "9" and get the result "("?

Programming a Shift key in this case will not work, and there will be no SendKeys based solution due to platform limitations.

This will be for a virtual keyboard, such as an on-screen keyboard in Silverlight.

+3
source share
5 answers

Could you spend a few minutes creating a mapping table?

1->!
2->@
3->#
etc. etc. etc.
+2
source

I would like to bring back the question: how do you know which keyboard layout is used? Ie, on one of my systems, number 2 has an @ value. On the other hand, it has a “-sign (double quotation mark). You say that 9 has (-sign, but I have (-sign over 0 and) -sign over minus sign.

Windows (, , , , , IBM .). AZERTY vs QWERTY ..,

: . . , , , , , , , , . , .

Shift ( , Shift ).

( , ASCII . , .)

EDIT: Microsoft. , , . , , , Shift- ( ) , - .

0

WPF SilverLight TextInput . TextCompositionEventArgs.Text. :

private void Window_TextInput(object sender, TextCompositionEventArgs e)
{
    // e.Text contains the character that corresponds to the
    // key combination that was pressed
    Trace.WriteLine("TEXT: " + e.Text);
}

, . WPF/Silverlight ( KeyConverter, , , numpad ), , -, , .

In Windows Forms applications (which, however, are not relevant here), the corresponding event for receiving the actual character will be Control.KeyPress.

0
source

find the math behind the numbers of each character and work with it ...

-1
source

Source: https://habr.com/ru/post/1727424/


All Articles