1
0

mouse_cfg 1.4: add double click delay option

git-svn-id: svn://kolibrios.org@5970 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2015-12-16 13:23:57 +00:00
parent 7cff3aa25b
commit 4fdcec9f51
2 changed files with 61 additions and 29 deletions
programs/cmm/mouse_cfg

View File

@ -13,16 +13,30 @@ inline fastcall void SetMouseSpeed(EDX) {
$int 0x40
}
inline fastcall int GetMouseDelay() {
inline fastcall int GetMouseAcceleration() {
$mov eax,18
$mov ebx,19
$mov ecx,2
$int 0x40
}
inline fastcall void SetMouseDelay(EDX) {
inline fastcall void SetMouseAcceleration(EDX) {
$mov eax,18
$mov ebx,19
$mov ecx,3
$int 0x40
}
inline fastcall int GetMouseDoubleClickDelay() {
$mov eax,18
$mov ebx,19
$mov ecx,6
$int 0x40
}
inline fastcall void SetMouseDoubleClickDelay(DL) {
$mov eax,18
$mov ebx,19
$mov ecx,6
$int 0x40
}

View File

@ -1,4 +1,4 @@
// Mouse Configuration Utility ver 1.3
// Mouse Configuration Utility ver 1.4
#ifndef AUTOBUILD
#include "lang.h--"
@ -21,7 +21,8 @@
?define CHECK_MOUSE_1 "<EFBFBD> ¦¬¨â¥ ­  í⮩ ®¡« áâ¨"
?define CHECK_MOUSE_2 "¤«ï ¯à®¢¥àª¨ ª­®¯®ª ¬ëè¨"
?define POINTER_SPEED "‘ª®à®áâì 㪠§ â¥«ï ¬ëè¨"
?define POINTER_DELAY "“᪮७¨¥ 㪠§ â¥«ï ¬ëè¨"
?define ACCELERATION_TEXT "“᪮७¨¥ 㪠§ â¥«ï ¬ëè¨"
?define DOUBLE_CLICK_TEXT "‡ ¤¥à¦ª  ¤¢®©­®£® ª«¨ª  ¬ëèìî"
?define MOUSE_EMULATION "<EFBFBD>¬ã«ïæ¨ï ã¯à ¢«¥­¨ï 㪠§ â¥«¥¬ ç¥à¥§ ª« ¢¨ âãàã"
?define MADMOUSE "‘ª¢®§­ë¥ ¤«ï ªãàá®à  áâ®à®­ë íªà ­ "
#else
@ -29,29 +30,30 @@
?define CHECK_MOUSE_1 "Click on this area to"
?define CHECK_MOUSE_2 "check your mouse buttons"
?define POINTER_SPEED "Mouse pointer speed"
?define POINTER_DELAY "Mouse pointer acceleration"
?define ACCELERATION_TEXT "Mouse pointer acceleration"
?define DOUBLE_CLICK_TEXT "Mouse double click delay"
?define MOUSE_EMULATION "Enable mouse emulation using keyboard NumPad"
?define MADMOUSE "Through screen sides for pointer"
#endif
proc_info Form;
frame mouse_frame = { 0, 000, 14, 130, 14, 0x000111, 0xFFFfff, 0, 0, 0, 0, 6, 0x000111, 0xCCCccc };
char pos_x = 22;
unsigned char panels_img_data[] = FROM "mouse_image.raw";
raw_image panels_img = { 59, 101, #panels_img_data };
char system_ini_path[] = "/sys/settings/system.ini";
char mouse_category[] = "mouse";
proc_info Form;
struct mouse_cfg1 {
struct _mouse_cfg {
char pointer_speed,
pointer_delay,
acceleration,
emulation,
madmouse,
button_clicked;
word double_click_delay;
} mouse_cfg;
@ -112,15 +114,25 @@ void main() {
mouse_cfg.pointer_speed--;
SetMouseSpeed(mouse_cfg.pointer_speed);
}
if (id==122) && (mouse_cfg.pointer_delay<3)
if (id==122) && (mouse_cfg.acceleration<3)
{
mouse_cfg.pointer_delay++;
SetMouseDelay(mouse_cfg.pointer_delay);
mouse_cfg.acceleration++;
SetMouseAcceleration(mouse_cfg.acceleration);
}
if (id==123) && (mouse_cfg.pointer_delay>0)
if (id==123) && (mouse_cfg.acceleration>0)
{
mouse_cfg.pointer_delay--;
SetMouseDelay(mouse_cfg.pointer_delay);
mouse_cfg.acceleration--;
SetMouseAcceleration(mouse_cfg.acceleration);
}
if (id==124)
{
mouse_cfg.double_click_delay+=10;
SetMouseDoubleClickDelay(mouse_cfg.double_click_delay);
}
if (id==125) && (mouse_cfg.double_click_delay>0)
{
mouse_cfg.double_click_delay-=10;
SetMouseDoubleClickDelay(mouse_cfg.double_click_delay);
}
DrawControls();
break;
@ -131,7 +143,7 @@ void main() {
case evReDraw:
system.color.get();
DefineAndDrawWindow(430, 150, 360, 280+GetSkinHeight(),0x34,system.color.work,WINDOW_TITLE);
DefineAndDrawWindow(430, 150, 360, 300+GetSkinHeight(),0x34,system.color.work,WINDOW_TITLE);
GetProcessInfo(#Form, SelfInfo);
if (Form.status_window>2) break;
SetFrameColors();
@ -145,13 +157,6 @@ void main() {
}
}
void PanelCfg_CheckBox(dword x, y, id, text, byte value) {
CheckBox(x, y, 14, 14, id, text, system.color.work_graph, system.color.work_text, value);
}
void PanelCfg_MoreLessBox(dword x, y, id_more, id_less; byte value; dword text) {
MoreLessBox(x, y, 18, id_more, id_less, #system.color, value, text);
}
void DrawMouseImage() {
_PutImage(mouse_frame.start_x+30, mouse_frame.start_y + 15, panels_img.w, panels_img.h,
@ -161,9 +166,10 @@ void DrawMouseImage() {
void DrawControls() {
DrawBar(pos_x, mouse_frame.start_y + 142, Form.cwidth - pos_x, 120, system.color.work);
PanelCfg_MoreLessBox(pos_x, mouse_frame.start_y + 142, 120, 121, mouse_cfg.pointer_speed, POINTER_SPEED);
PanelCfg_MoreLessBox(pos_x, mouse_frame.start_y + 170, 122, 123, mouse_cfg.pointer_delay, POINTER_DELAY);
PanelCfg_CheckBox(pos_x, mouse_frame.start_y + 202, 100, MOUSE_EMULATION, mouse_cfg.emulation);
PanelCfg_CheckBox(pos_x, mouse_frame.start_y + 226, 101, MADMOUSE, mouse_cfg.madmouse);
PanelCfg_MoreLessBox(pos_x, mouse_frame.start_y + 170, 122, 123, mouse_cfg.acceleration, ACCELERATION_TEXT);
PanelCfg_MoreLessBox(pos_x, mouse_frame.start_y + 198, 124, 125, mouse_cfg.double_click_delay, DOUBLE_CLICK_TEXT);
PanelCfg_CheckBox(pos_x, mouse_frame.start_y + 230, 100, MOUSE_EMULATION, mouse_cfg.emulation);
PanelCfg_CheckBox(pos_x, mouse_frame.start_y + 254, 101, MADMOUSE, mouse_cfg.madmouse);
}
void SetFrameColors() {
@ -174,18 +180,30 @@ void SetFrameColors() {
}
void LoadCfg() {
ini_get_int stdcall (#system_ini_path, #mouse_category, "delay", GetMouseDelay()); mouse_cfg.pointer_delay = EAX;
ini_get_int stdcall (#system_ini_path, #mouse_category, "acceleration", GetMouseAcceleration()); mouse_cfg.acceleration = EAX;
ini_get_int stdcall (#system_ini_path, #mouse_category, "speed", GetMouseSpeed()); mouse_cfg.pointer_speed = EAX;
ini_get_int stdcall (#system_ini_path, #mouse_category, "double_click_delay", GetMouseDoubleClickDelay()); mouse_cfg.double_click_delay = EAX;
mouse_cfg.madmouse = CheckProcessExists("MADMOUSE");
mouse_cfg.emulation = CheckProcessExists("MOUSEMUL");
}
void ExitApp() {
ini_set_int stdcall (#system_ini_path, #mouse_category, "delay", mouse_cfg.pointer_delay);
ini_set_int stdcall (#system_ini_path, #mouse_category, "acceleration", mouse_cfg.acceleration);
ini_set_int stdcall (#system_ini_path, #mouse_category, "speed", mouse_cfg.pointer_speed);
ini_set_int stdcall (#system_ini_path, #mouse_category, "double_click_delay", mouse_cfg.double_click_delay);
ExitProcess();
}
void PanelCfg_CheckBox(dword x, y, id, text, byte value) {
CheckBox(x, y, 14, 14, id, text, system.color.work_graph, system.color.work_text, value);
}
void PanelCfg_MoreLessBox(dword x, y, id_more, id_less; word value; dword text) {
MoreLessBox(x, y, 18, id_more, id_less, #system.color, value, text);
}
stop: