summaryrefslogtreecommitdiff
path: root/uisimulator/win32/uisw32.c
diff options
context:
space:
mode:
authorJörg Hohensohn <hohensoh@rockbox.org>2003-04-19 13:15:33 +0000
committerJörg Hohensohn <hohensoh@rockbox.org>2003-04-19 13:15:33 +0000
commitc6fb565dd98d2da0cd5ba0e29b73c49617edcb9c (patch)
tree44ab870d30d5f5872a4bb35d49936185296616e3 /uisimulator/win32/uisw32.c
parent6d522179dcbba409768a02845237967f39264e85 (diff)
most of UI sim patch 708460 from Magnus Holmgren, except the bitmap removal
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3571 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'uisimulator/win32/uisw32.c')
-rw-r--r--uisimulator/win32/uisw32.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/uisimulator/win32/uisw32.c b/uisimulator/win32/uisw32.c
index b4747b138e..3cfa3aed7c 100644
--- a/uisimulator/win32/uisw32.c
+++ b/uisimulator/win32/uisw32.c
@@ -34,6 +34,8 @@
extern void app_main (void *); // mod entry point
extern void new_key(int key);
+void button_event(int key, bool pressed);
+
// variables
HWND hGUIWnd; // the GUI window handle
unsigned int uThreadID; // id of mod thread
@@ -172,7 +174,7 @@ LRESULT GUIWndProc (
RECT r;
GetClientRect (hWnd, &r);
- // blit to screen
+ // blit background image to screen
StretchBlt (hDc, 0, 0, r.right, r.bottom,
hMemDc, 0, 0, UI_WIDTH, UI_HEIGHT, SRCCOPY);
EndPaint (hWnd, &ps);
@@ -187,8 +189,10 @@ LRESULT GUIWndProc (
GetClientRect (hWnd, &r);
// draw lcd screen
StretchDIBits (hDc,
- UI_LCD_POSX * r.right / UI_WIDTH, UI_LCD_POSY * r.bottom / UI_HEIGHT,
- LCD_WIDTH * r.right / UI_WIDTH, LCD_HEIGHT * r.bottom / UI_HEIGHT,
+ UI_LCD_POSX * r.right / UI_WIDTH,
+ UI_LCD_POSY * r.bottom / UI_HEIGHT,
+ UI_LCD_WIDTH * r.right / UI_WIDTH,
+ UI_LCD_HEIGHT * r.bottom / UI_HEIGHT,
0, 0, LCD_WIDTH, LCD_HEIGHT,
bitmap, (BITMAPINFO *) &bmi, DIB_RGB_COLORS, SRCCOPY);
@@ -206,6 +210,12 @@ LRESULT GUIWndProc (
hGUIWnd = NULL;
PostQuitMessage (0);
break;
+ case WM_KEYDOWN:
+ button_event(wParam, true);
+ break;
+ case WM_KEYUP:
+ button_event(wParam, false);
+ break;
}
return DefWindowProc (hWnd, uMsg, wParam, lParam);