Subversion Repositories Kolibri OS

Rev

Rev 8954 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 8954 Rev 9261
Line 1... Line 1...
1
// Mouse Configuration Utility ver 1.62
1
// Mouse Configuration Utility ver 1.7
Line 2... Line 2...
2
 
2
 
Line 3... Line 3...
3
#define MEMSIZE 4096*11
3
#define MEMSIZE 4096*11
4
 
4
 
Line 15... Line 15...
15
	?define CHECK_MOUSE_1 " ¦¬¨â¥ ­  í⮩ ®¡« áâ¨"
15
	?define CHECK_MOUSE_1 " ¦¬¨â¥ ­  í⮩ ®¡« áâ¨"
16
	?define CHECK_MOUSE_2 "¤«ï ¯à®¢¥àª¨ ª­®¯®ª ¬ëè¨"
16
	?define CHECK_MOUSE_2 "¤«ï ¯à®¢¥àª¨ ª­®¯®ª ¬ëè¨"
17
	?define POINTER_SPEED "„¥«¨â¥«ì ᪮à®á⨠㪠§ â¥«ï ¬ëè¨"
17
	?define POINTER_SPEED "„¥«¨â¥«ì ᪮à®á⨠㪠§ â¥«ï ¬ëè¨"
18
	?define ACCELERATION_TEXT "—ã¢á⢨⥫쭮áâì 㪠§ â¥«ï ¬ëè¨"
18
	?define ACCELERATION_TEXT "—ã¢á⢨⥫쭮áâì 㪠§ â¥«ï ¬ëè¨"
19
	?define DOUBLE_CLICK_TEXT "‡ ¤¥à¦ª  ¤¢®©­®£® ª«¨ª  ¬ëèìî"
19
	?define DOUBLE_CLICK_TEXT "‡ ¤¥à¦ª  ¤¢®©­®£® ª«¨ª  ¬ëèìî"
20
	?define MOUSE_EMULATION "“¯à ¢«¥­¨¥ 㪠§ â¥«¥¬ ¬ëè¨ ç¥à¥§ ª« ¢¨ âãàã"
20
	?define MOUSE_EMULATION "“¯à ¢«¥­¨¥ 㪠§ â¥«¥¬ ¬ëè¨ ç¥à¥§ ª« ¢¨ âãàã (F1)"
-
 
21
	?define COMMOUSE "‡ £à㧨âì ¤à ©¢¥à ¬ëè¨ ¤«ï COM-¯®àâ  (F2)"
21
	?define MADMOUSE "‘ª¢®§­ë¥ ¤«ï ªãàá®à  áâ®à®­ë íªà ­ "
22
	?define MADMOUSE "‘ª¢®§­ë¥ ¤«ï ªãàá®à  áâ®à®­ë íªà ­ "
22
	?define COMMOUSE "‡ £à㧨âì ¤à ©¢¥à ¬ëè¨ ¤«ï COM-¯®àâ  (F10)"
-
 
23
	?define COMMOUSE_LOADED "'„à ©¢¥à ¤«ï COM ¬ëè¨ ¡ë« § £à㦥­' -O"
23
	?define COMMOUSE_LOADED "'„à ©¢¥à ¤«ï COM ¬ëè¨ ¡ë« § £à㦥­' -O"
24
	?define COMMOUSE_CAN_NOT_UNLOAD "'Žáâ ­®¢ª  ¤à ©¢¥à  ­¥¢®§¬®¦­ ' -W"
24
	?define COMMOUSE_CAN_NOT_UNLOAD "'Žáâ ­®¢ª  ¤à ©¢¥à  ­¥¢®§¬®¦­ ' -W"
25
#else
25
#else
26
	?define WINDOW_TITLE "Mouse testing and configuration"
26
	?define WINDOW_TITLE "Mouse testing and configuration"
27
	?define CHECK_MOUSE_1 "Click on this area to"
27
	?define CHECK_MOUSE_1 "Click on this area to"
28
	?define CHECK_MOUSE_2 "check your mouse buttons"
28
	?define CHECK_MOUSE_2 "check your mouse buttons"
29
	?define POINTER_SPEED "Mouse pointer speed divider"
29
	?define POINTER_SPEED "Mouse pointer speed divider"
30
	?define ACCELERATION_TEXT "Mouse pointer sensitivity"
30
	?define ACCELERATION_TEXT "Mouse pointer sensitivity"
31
	?define DOUBLE_CLICK_TEXT "Mouse double click delay"
31
	?define DOUBLE_CLICK_TEXT "Mouse double click delay"
32
	?define MOUSE_EMULATION "Enable mouse emulation using keyboard NumPad"
32
	?define MOUSE_EMULATION "Enable mouse emulation using keyboard NumPad (F1)"
-
 
33
	?define COMMOUSE "Load mouse driver for COM-port (F2)"
33
	?define MADMOUSE "Through screen sides for pointer"
34
	?define MADMOUSE "Through screen sides for pointer"
34
	?define COMMOUSE "Load mouse driver for COM-port (F10)"
-
 
35
	?define COMMOUSE_LOADED "'Driver for COM mouse loaded' -O"
35
	?define COMMOUSE_LOADED "'Driver for COM mouse loaded' -O"
36
	?define COMMOUSE_CAN_NOT_UNLOAD "'Driver stop is impossible' -W"
36
	?define COMMOUSE_CAN_NOT_UNLOAD "'Driver stop is impossible' -W"
37
#endif
37
#endif
Line 38... Line 38...
38
 
38
 
Line 73... Line 73...
73
				IF (1 == id) ExitApp();
73
				IF (1 == id) ExitApp();
74
				else IF (pointer_speed.click(id)) ApplyCfg();
74
				else IF (pointer_speed.click(id)) ApplyCfg();
75
				else IF (acceleration.click(id)) ApplyCfg();
75
				else IF (acceleration.click(id)) ApplyCfg();
76
				else IF (double_click_delay.click(id)) ApplyCfg();
76
				else IF (double_click_delay.click(id)) ApplyCfg();
77
				else IF (emulation.click(id)) {
77
				else IF (emulation.click(id)) {
78
					IF (emulation.checked == true) RunProgram("/sys/mousemul", 0);
-
 
79
					ELSE KillProcessByName("mousemul", SINGLE);
78
					EventClickEmulation();
80
					break;
-
 
81
				}
79
				}
82
				else IF (madmouse.click(id)) {						
80
				else IF (madmouse.click(id)) {
83
					IF (madmouse.checked == true) RunProgram("/sys/madmouse", 0);
81
					IF (madmouse.checked == true) RunProgram("/sys/madmouse", 0);
84
					ELSE KillProcessByName("madmouse", SINGLE);
82
					ELSE KillProcessByName("madmouse", SINGLE);
85
					break;
83
					break;
Line 90... Line 88...
90
				break;
88
				break;
Line 91... Line 89...
91
 
89
 
92
		case evKey:
90
		case evKey:
93
				@GetKeyScancode();
91
				@GetKeyScancode();
-
 
92
				IF (AL == SCAN_CODE_ESC) ExitApp();
-
 
93
				IF (AL == SCAN_CODE_F1) {
-
 
94
					emulation.click(emulation.id);
-
 
95
					EventClickEmulation();
94
				IF (AL == SCAN_CODE_ESC) ExitApp();
96
				}
95
				IF (AL == SCAN_CODE_F10) EventClickComMouse();
97
				IF (AL == SCAN_CODE_F2) EventClickComMouse();
Line 96... Line 98...
96
				break;
98
				break;
97
			
99
 
98
		case evReDraw:
100
		case evReDraw:
99
				sc.get();
101
				sc.get();
100
				DefineAndDrawWindow(430, 150, 424, 343+skin_height,0x34,sc.work,WINDOW_TITLE,0);
102
				DefineAndDrawWindow(430, 150, 460, 343+skin_height,0x34,sc.work,WINDOW_TITLE,0);
101
				GetProcessInfo(#Form, SelfInfo);
103
				GetProcessInfo(#Form, SelfInfo);
102
				if (Form.status_window&ROLLED_UP) break;
104
				if (Form.status_window&ROLLED_UP) break;
103
				mouse_frame.w = - FRAME_X * 2 + Form.cwidth;
105
				mouse_frame.w = - FRAME_X * 2 + Form.cwidth;
Line 143... Line 145...
143
	y.n = FRAME_Y+115;
145
	y.n = FRAME_Y+115;
144
	pointer_speed.draw(FRAME_X, y.inc(30));
146
	pointer_speed.draw(FRAME_X, y.inc(30));
145
	acceleration.draw(FRAME_X, y.inc(30));
147
	acceleration.draw(FRAME_X, y.inc(30));
146
	double_click_delay.draw(FRAME_X, y.inc(30));
148
	double_click_delay.draw(FRAME_X, y.inc(30));
147
	emulation.draw(FRAME_X, y.inc(33));
149
	emulation.draw(FRAME_X, y.inc(33));
148
	madmouse.draw(FRAME_X, y.inc(27));
-
 
149
	com_mouse.draw(FRAME_X, y.inc(27));
150
	com_mouse.draw(FRAME_X, y.inc(27));
-
 
151
	madmouse.draw(FRAME_X, y.inc(27));
150
}
152
}
Line 151... Line 153...
151
 
153
 
152
void LoadCfg() {
154
void LoadCfg() {
153
	acceleration.value = @GetMouseAcceleration();
155
	acceleration.value = @GetMouseAcceleration();
Line 185... Line 187...
185
	} else {
187
	} else {
186
		notify(COMMOUSE_CAN_NOT_UNLOAD);
188
		notify(COMMOUSE_CAN_NOT_UNLOAD);
187
	}
189
	}
188
}
190
}
Line -... Line 191...
-
 
191
 
-
 
192
void EventClickEmulation()
-
 
193
{
-
 
194
	IF (emulation.checked == true) {
-
 
195
		RunProgram("/sys/mousemul", 0);
-
 
196
	}	ELSE {
-
 
197
		KillProcessByName("mousemul", SINGLE);
-
 
198
	}
-
 
199
}
189
 
200