mirror of
https://gitea.nishi.boats/pyrite-dev/milsko
synced 2026-01-18 23:24:06 +00:00
more handler
git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@268 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
@@ -81,13 +81,19 @@ static LRESULT CALLBACK wndproc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp) {
|
||||
int n = wp;
|
||||
|
||||
MwLLDispatch(u->ll, key, &n);
|
||||
} else if(msg == WM_KEYDOWN) {
|
||||
} else if(msg == WM_KEYDOWN || msg == WM_KEYUP) {
|
||||
int n = -1;
|
||||
if(wp == VK_LEFT) n = MwLLKeyLeft;
|
||||
if(wp == VK_RIGHT) n = MwLLKeyRight;
|
||||
if(wp == VK_UP) n = MwLLKeyUp;
|
||||
if(wp == VK_DOWN) n = MwLLKeyDown;
|
||||
if(n != -1) MwLLDispatch(u->ll, key, &n);
|
||||
if(n != -1) {
|
||||
if(msg == WM_KEYDOWN) {
|
||||
MwLLDispatch(u->ll, key, &n);
|
||||
} else {
|
||||
MwLLDispatch(u->ll, key_released, &n);
|
||||
}
|
||||
}
|
||||
} else if(msg == WM_GETMINMAXINFO) {
|
||||
if(u->min_set || u->max_set) {
|
||||
LPARAM style = GetWindowLongPtr(hWnd, GWL_STYLE);
|
||||
|
||||
@@ -200,7 +200,7 @@ void MwLLNextEvent(MwLL handle) {
|
||||
p.y = ev.xmotion.y;
|
||||
|
||||
MwLLDispatch(handle, move, &p);
|
||||
} else if(ev.type == KeyPress) {
|
||||
} else if(ev.type == KeyPress || ev.type == KeyRelease) {
|
||||
int n = -1;
|
||||
char str[512];
|
||||
KeySym sym;
|
||||
@@ -237,7 +237,13 @@ void MwLLNextEvent(MwLL handle) {
|
||||
n = MwLLKeyDown;
|
||||
}
|
||||
|
||||
if(n != -1) MwLLDispatch(handle, key, &n);
|
||||
if(n != -1) {
|
||||
if(ev.type == KeyPress) {
|
||||
MwLLDispatch(handle, key, &n);
|
||||
} else {
|
||||
MwLLDispatch(handle, key_released, &n);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(render) {
|
||||
int x, y;
|
||||
|
||||
Reference in New Issue
Block a user