From 642bfaad85ec98b11de204ebda5a3d4d0cb67a7c Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Fri, 20 Apr 2018 20:42:48 +0000 Subject: [PATCH] fix mousecfg (thanks tsdima for report) git-svn-id: svn://kolibrios.org@7248 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/lib/keyboard.h | 5 +++++ programs/cmm/mousecfg/mousecfg.c | 22 ++++++++++------------ 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/programs/cmm/lib/keyboard.h b/programs/cmm/lib/keyboard.h index 9d41a93a3e..4040ebdfe5 100644 --- a/programs/cmm/lib/keyboard.h +++ b/programs/cmm/lib/keyboard.h @@ -52,6 +52,11 @@ #define SCAN_CODE_KEY_P 025 #define SCAN_CODE_KEY_R 019 #define SCAN_CODE_KEY_S 031 +#define SCAN_CODE_KEY_V 047 +#define SCAN_CODE_KEY_X 045 +#define SCAN_CODE_KEY_Y 021 +#define SCAN_CODE_KEY_Z 044 + #define KEY_LSHIFT 00000000001b #define KEY_RSHIFT 00000000010b diff --git a/programs/cmm/mousecfg/mousecfg.c b/programs/cmm/mousecfg/mousecfg.c index 9d8350fbaf..79341b4f2f 100644 --- a/programs/cmm/mousecfg/mousecfg.c +++ b/programs/cmm/mousecfg/mousecfg.c @@ -40,7 +40,6 @@ block mouse_frame = { 18, 18, NULL, 130 }; more_less_box pointer_speed = { NULL, 0, 64, POINTER_SPEED }; more_less_box acceleration = { NULL, 0, 64, ACCELERATION_TEXT }; more_less_box double_click_delay = { NULL, 0, 999, DOUBLE_CLICK_TEXT, 8 }; - checkbox emulation = { MOUSE_EMULATION, NULL }; checkbox madmouse = { MADMOUSE, NULL }; @@ -49,12 +48,12 @@ raw_image panels_img = { 59, 101, #panels_img_data }; _ini ini = { "/sys/settings/system.ini", "mouse" }; +dword click_status; void main() { char id; - int click_status; load_dll(libini, #lib_init,1); load_dll(boxlib, #box_lib_init,0); @@ -71,11 +70,11 @@ void main() { if (mouse.key&MOUSE_LEFT) click_status = 1; if (mouse.key&MOUSE_RIGHT) click_status = 2; if (mouse.key&MOUSE_CENTER) click_status = 3; - DrawMouseImage(click_status); + DrawMouseImage(); } if (mouse.up) { click_status=0; - DrawMouseImage(click_status); + DrawMouseImage(); } break; @@ -116,20 +115,19 @@ void main() { } -void DrawMouseImage(dword status) { +void DrawMouseImage() { _PutImage(mouse_frame.x+30, mouse_frame.y + 15, panels_img.w, panels_img.h, - status * panels_img.w * panels_img.h * 3 + panels_img.data); + click_status * panels_img.w * panels_img.h * 3 + panels_img.data); } void DrawControls() { - int x = mouse_frame.x; incn y; y.n = mouse_frame.y+115; - pointer_speed.draw(x, y.inc(30)); - acceleration.draw(x, y.inc(30)); - double_click_delay.draw(x, y.inc(30)); - emulation.draw(x, y.inc(33)); - madmouse.draw(x, y.inc(27)); + pointer_speed.draw(mouse_frame.x, y.inc(30)); + acceleration.draw(mouse_frame.x, y.inc(30)); + double_click_delay.draw(mouse_frame.x, y.inc(30)); + emulation.draw(mouse_frame.x, y.inc(33)); + madmouse.draw(mouse_frame.x, y.inc(27)); } void LoadCfg() {