aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTomaka17 <pierre.krieger1708@gmail.com>2014-07-27 18:39:22 +0200
committerTomaka17 <pierre.krieger1708@gmail.com>2014-07-27 18:39:22 +0200
commit754a6ef60f87946de3d54d53b27e26d05c1fc47a (patch)
tree49a7690e26f93fd636e89443fca272e6e87165d0 /src
parentc67ab381bf024461793798be255c5351c47fb8b0 (diff)
downloadglutin-754a6ef60f87946de3d54d53b27e26d05c1fc47a.tar.gz
glutin-754a6ef60f87946de3d54d53b27e26d05c1fc47a.zip
Implement ReceivedCharacter on win32
Diffstat (limited to 'src')
-rw-r--r--src/win32/ffi.rs1
-rw-r--r--src/win32/mod.rs8
2 files changed, 9 insertions, 0 deletions
diff --git a/src/win32/ffi.rs b/src/win32/ffi.rs
index 5051c46..937de67 100644
--- a/src/win32/ffi.rs
+++ b/src/win32/ffi.rs
@@ -159,6 +159,7 @@ pub static SWP_NOZORDER: UINT = 0x0004;
pub static SWP_SHOWWINDOW: UINT = 0x0040;
// messages
+pub static WM_CHAR: UINT = 0x0102;
pub static WM_COMMAND: UINT = 0x0111;
pub static WM_DESTROY: UINT = 0x0002;
pub static WM_MOUSEMOVE: UINT = 0x0200;
diff --git a/src/win32/mod.rs b/src/win32/mod.rs
index a13aa74..d8e2df2 100644
--- a/src/win32/mod.rs
+++ b/src/win32/mod.rs
@@ -321,6 +321,14 @@ extern "stdcall" fn callback(window: ffi::HWND, msg: ffi::UINT,
0
},
+ ffi::WM_CHAR => {
+ use std::mem;
+ use events::ReceivedCharacter;
+ let chr: char = unsafe { mem::transmute(wparam) };
+ send_event(window, ReceivedCharacter(chr));
+ 0
+ },
+
ffi::WM_MOUSEMOVE => {
use CursorPositionChanged;