This commit is contained in:
Daniel Collin 2016-07-08 20:13:44 +02:00
commit f848eaaee5
4 changed files with 21 additions and 3 deletions

View file

@ -2,6 +2,11 @@
This project follows semantic versioning.
### v0.8.1 (2016-07-07)
- [fixed] Character callback wouldn't get called on Mac and Linux
- [fixed] Resize cursors on Windows was swapped
### v0.8.0 (2016-06-24)
- [added] ```window.set_title``` Can now change title after creation

View file

@ -1,6 +1,6 @@
[package]
name = "minifb"
version = "0.8.0"
version = "0.8.1"
license = "MIT/Apache-2.0"
authors = ["Daniel Collin <daniel@collin.com>"]
description = "Cross-platform window setup with optional bitmap rendering"

View file

@ -14,7 +14,7 @@ Usage
```toml
# Cargo.toml
[dependencies]
minifb = "0.8.0"
minifb = "0.8.1"
```
Example

View file

@ -145,6 +145,11 @@ fn update_key_state(window: &mut Window, wparam: u32, state: bool) {
}
}
fn char_down(window: &mut Window, code_point: u32) {
if let Some(ref mut callback) = window.key_handler.key_callback {
callback.add_char(code_point);
}
}
#[cfg(target_arch = "x86_64")]
unsafe fn set_window_long(window: winapi::HWND, data: winapi::LONG_PTR) -> winapi::LONG_PTR {
@ -203,6 +208,14 @@ unsafe extern "system" fn wnd_proc(window: winapi::HWND,
return 0;
}
winapi::winuser::WM_CHAR => {
char_down(wnd, wparam as u32);
}
winapi::winuser::WM_SYSCHAR => {
char_down(wnd, wparam as u32);
}
winapi::winuser::WM_LBUTTONDOWN => {
wnd.mouse.state[0] = true
}
@ -463,8 +476,8 @@ impl Window {
user32::LoadCursorW(ptr::null_mut(), winuser::IDC_CROSS),
user32::LoadCursorW(ptr::null_mut(), winuser::IDC_HAND),
user32::LoadCursorW(ptr::null_mut(), winuser::IDC_HAND),
user32::LoadCursorW(ptr::null_mut(), winuser::IDC_SIZENS),
user32::LoadCursorW(ptr::null_mut(), winuser::IDC_SIZEWE),
user32::LoadCursorW(ptr::null_mut(), winuser::IDC_SIZENS),
user32::LoadCursorW(ptr::null_mut(), winuser::IDC_SIZEALL),
],
};