Raise KeyPress events (handle WindowsMessage.CHAR message).
This commit is contained in:
parent
072de099ae
commit
bee2c0808a
1 changed files with 12 additions and 0 deletions
|
@ -80,6 +80,8 @@ namespace OpenTK.Platform.Windows
|
|||
const long ExtendedBit = 1 << 24; // Used to distinguish left and right control, alt and enter keys.
|
||||
static readonly uint ShiftRightScanCode = Functions.MapVirtualKey(VirtualKeys.RSHIFT, 0); // Used to distinguish left and right shift keys.
|
||||
|
||||
KeyPressEventArgs key_press = new KeyPressEventArgs((char)0);
|
||||
|
||||
#endregion
|
||||
|
||||
#region Contructors
|
||||
|
@ -217,6 +219,16 @@ namespace OpenTK.Platform.Windows
|
|||
|
||||
#region Input events
|
||||
|
||||
case WindowMessage.CHAR:
|
||||
if (IntPtr.Size == 4)
|
||||
key_press.KeyChar = (char)wParam.ToInt32();
|
||||
else
|
||||
key_press.KeyChar = (char)wParam.ToInt64();
|
||||
|
||||
if (KeyPress != null)
|
||||
KeyPress(this, key_press);
|
||||
break;
|
||||
|
||||
//case WindowMessage.MOUSELEAVE:
|
||||
// Cursor.Current = Cursors.Default;
|
||||
// break;
|
||||
|
|
Loading…
Reference in a new issue