Raise KeyPress events (handle WindowsMessage.CHAR message).

This commit is contained in:
the_fiddler 2009-09-26 21:56:42 +00:00
parent 072de099ae
commit bee2c0808a

View file

@ -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;