forked from KolibriOS/kolibrios
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:
parent
7cff3aa25b
commit
4fdcec9f51
@ -13,16 +13,30 @@ inline fastcall void SetMouseSpeed(EDX) {
|
|||||||
$int 0x40
|
$int 0x40
|
||||||
}
|
}
|
||||||
|
|
||||||
inline fastcall int GetMouseDelay() {
|
inline fastcall int GetMouseAcceleration() {
|
||||||
$mov eax,18
|
$mov eax,18
|
||||||
$mov ebx,19
|
$mov ebx,19
|
||||||
$mov ecx,2
|
$mov ecx,2
|
||||||
$int 0x40
|
$int 0x40
|
||||||
}
|
}
|
||||||
|
|
||||||
inline fastcall void SetMouseDelay(EDX) {
|
inline fastcall void SetMouseAcceleration(EDX) {
|
||||||
$mov eax,18
|
$mov eax,18
|
||||||
$mov ebx,19
|
$mov ebx,19
|
||||||
$mov ecx,3
|
$mov ecx,3
|
||||||
$int 0x40
|
$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
|
||||||
|
}
|
@ -1,4 +1,4 @@
|
|||||||
// Mouse Configuration Utility ver 1.3
|
// Mouse Configuration Utility ver 1.4
|
||||||
|
|
||||||
#ifndef AUTOBUILD
|
#ifndef AUTOBUILD
|
||||||
#include "lang.h--"
|
#include "lang.h--"
|
||||||
@ -21,7 +21,8 @@
|
|||||||
?define CHECK_MOUSE_1 "<EFBFBD> ¦¬¨â¥ í⮩ ®¡« áâ¨"
|
?define CHECK_MOUSE_1 "<EFBFBD> ¦¬¨â¥ í⮩ ®¡« áâ¨"
|
||||||
?define CHECK_MOUSE_2 "¤«ï ¯à®¢¥àª¨ ª®¯®ª ¬ëè¨"
|
?define CHECK_MOUSE_2 "¤«ï ¯à®¢¥àª¨ ª®¯®ª ¬ëè¨"
|
||||||
?define POINTER_SPEED "‘ª®à®áâì 㪠§ â¥«ï ¬ëè¨"
|
?define POINTER_SPEED "‘ª®à®áâì 㪠§ â¥«ï ¬ëè¨"
|
||||||
?define POINTER_DELAY "“᪮२¥ 㪠§ â¥«ï ¬ëè¨"
|
?define ACCELERATION_TEXT "“᪮२¥ 㪠§ â¥«ï ¬ëè¨"
|
||||||
|
?define DOUBLE_CLICK_TEXT "‡ ¤¥à¦ª ¤¢®©®£® ª«¨ª ¬ëèìî"
|
||||||
?define MOUSE_EMULATION "<EFBFBD>¬ã«ïæ¨ï ã¯à ¢«¥¨ï 㪠§ ⥫¥¬ ç¥à¥§ ª« ¢¨ âãàã"
|
?define MOUSE_EMULATION "<EFBFBD>¬ã«ïæ¨ï ã¯à ¢«¥¨ï 㪠§ ⥫¥¬ ç¥à¥§ ª« ¢¨ âãàã"
|
||||||
?define MADMOUSE "‘ª¢®§ë¥ ¤«ï ªãàá®à áâ®à®ë íªà "
|
?define MADMOUSE "‘ª¢®§ë¥ ¤«ï ªãàá®à áâ®à®ë íªà "
|
||||||
#else
|
#else
|
||||||
@ -29,29 +30,30 @@
|
|||||||
?define CHECK_MOUSE_1 "Click on this area to"
|
?define CHECK_MOUSE_1 "Click on this area to"
|
||||||
?define CHECK_MOUSE_2 "check your mouse buttons"
|
?define CHECK_MOUSE_2 "check your mouse buttons"
|
||||||
?define POINTER_SPEED "Mouse pointer speed"
|
?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 MOUSE_EMULATION "Enable mouse emulation using keyboard NumPad"
|
||||||
?define MADMOUSE "Through screen sides for pointer"
|
?define MADMOUSE "Through screen sides for pointer"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
proc_info Form;
|
||||||
frame mouse_frame = { 0, 000, 14, 130, 14, 0x000111, 0xFFFfff, 0, 0, 0, 0, 6, 0x000111, 0xCCCccc };
|
frame mouse_frame = { 0, 000, 14, 130, 14, 0x000111, 0xFFFfff, 0, 0, 0, 0, 6, 0x000111, 0xCCCccc };
|
||||||
char pos_x = 22;
|
char pos_x = 22;
|
||||||
|
|
||||||
|
|
||||||
unsigned char panels_img_data[] = FROM "mouse_image.raw";
|
unsigned char panels_img_data[] = FROM "mouse_image.raw";
|
||||||
raw_image panels_img = { 59, 101, #panels_img_data };
|
raw_image panels_img = { 59, 101, #panels_img_data };
|
||||||
|
|
||||||
char system_ini_path[] = "/sys/settings/system.ini";
|
char system_ini_path[] = "/sys/settings/system.ini";
|
||||||
char mouse_category[] = "mouse";
|
char mouse_category[] = "mouse";
|
||||||
|
|
||||||
proc_info Form;
|
|
||||||
|
|
||||||
|
struct _mouse_cfg {
|
||||||
struct mouse_cfg1 {
|
|
||||||
char pointer_speed,
|
char pointer_speed,
|
||||||
pointer_delay,
|
acceleration,
|
||||||
emulation,
|
emulation,
|
||||||
madmouse,
|
madmouse,
|
||||||
button_clicked;
|
button_clicked;
|
||||||
|
word double_click_delay;
|
||||||
} mouse_cfg;
|
} mouse_cfg;
|
||||||
|
|
||||||
|
|
||||||
@ -112,15 +114,25 @@ void main() {
|
|||||||
mouse_cfg.pointer_speed--;
|
mouse_cfg.pointer_speed--;
|
||||||
SetMouseSpeed(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++;
|
mouse_cfg.acceleration++;
|
||||||
SetMouseDelay(mouse_cfg.pointer_delay);
|
SetMouseAcceleration(mouse_cfg.acceleration);
|
||||||
}
|
}
|
||||||
if (id==123) && (mouse_cfg.pointer_delay>0)
|
if (id==123) && (mouse_cfg.acceleration>0)
|
||||||
{
|
{
|
||||||
mouse_cfg.pointer_delay--;
|
mouse_cfg.acceleration--;
|
||||||
SetMouseDelay(mouse_cfg.pointer_delay);
|
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();
|
DrawControls();
|
||||||
break;
|
break;
|
||||||
@ -131,7 +143,7 @@ void main() {
|
|||||||
|
|
||||||
case evReDraw:
|
case evReDraw:
|
||||||
system.color.get();
|
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);
|
GetProcessInfo(#Form, SelfInfo);
|
||||||
if (Form.status_window>2) break;
|
if (Form.status_window>2) break;
|
||||||
SetFrameColors();
|
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() {
|
void DrawMouseImage() {
|
||||||
_PutImage(mouse_frame.start_x+30, mouse_frame.start_y + 15, panels_img.w, panels_img.h,
|
_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() {
|
void DrawControls() {
|
||||||
DrawBar(pos_x, mouse_frame.start_y + 142, Form.cwidth - pos_x, 120, system.color.work);
|
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 + 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_MoreLessBox(pos_x, mouse_frame.start_y + 170, 122, 123, mouse_cfg.acceleration, ACCELERATION_TEXT);
|
||||||
PanelCfg_CheckBox(pos_x, mouse_frame.start_y + 202, 100, MOUSE_EMULATION, mouse_cfg.emulation);
|
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 + 226, 101, MADMOUSE, mouse_cfg.madmouse);
|
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() {
|
void SetFrameColors() {
|
||||||
@ -174,18 +180,30 @@ void SetFrameColors() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void LoadCfg() {
|
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, "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.madmouse = CheckProcessExists("MADMOUSE");
|
||||||
mouse_cfg.emulation = CheckProcessExists("MOUSEMUL");
|
mouse_cfg.emulation = CheckProcessExists("MOUSEMUL");
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExitApp() {
|
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, "speed", mouse_cfg.pointer_speed);
|
||||||
|
ini_set_int stdcall (#system_ini_path, #mouse_category, "double_click_delay", mouse_cfg.double_click_delay);
|
||||||
ExitProcess();
|
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:
|
stop:
|
Loading…
Reference in New Issue
Block a user