39
48
byte Directional_down_left;
40
49
byte Directional_left;
41
50
byte Directional_up_left;
51
byte Directional_click;
42
53
long Directional_delay;
43
54
long Directional_last_move;
44
55
long Directional_step;
45
short Mouse_count; // Number of mouse movements received in the current Get_input()
56
int Mouse_moved; ///< Boolean, Set to true if any cursor movement occurs.
47
58
word Input_new_mouse_X;
48
59
word Input_new_mouse_Y;
101
112
int Move_cursor_with_constraints()
104
byte bl=0;//BL va indiquer si on doit corriger la position du curseur
115
int mouse_blocked=0; ///< Boolean, Set to true if mouse movement was clipped.
106
118
// Clip mouse to the editing area. There can be a border when using big
107
119
// pixels, if the SDL screen dimensions are not factors of the pixel size.
108
120
if (Input_new_mouse_Y>=Screen_height)
110
122
Input_new_mouse_Y=Screen_height-1;
113
125
if (Input_new_mouse_X>=Screen_width)
115
127
Input_new_mouse_X=Screen_width-1;
118
130
//Gestion "avanc�e" du curseur: interdire la descente du curseur dans le
119
131
//menu lorsqu'on est en train de travailler dans l'image
153
165
(Input_new_mouse_Y != Mouse_Y) ||
154
166
(Input_new_mouse_K != Mouse_K))
168
// On every change of mouse state
156
169
if ((Input_new_mouse_K != Mouse_K))
158
Hide_cursor(); // On efface le curseur AVANT de le d�placer...
173
if (Input_new_mouse_K == 0)
174
Input_sticky_control = 0;
176
// Hide cursor, because even just a click change needs it
180
// Hide cursor (erasing icon and brush on screen
181
// before changing the coordinates.
159
184
if (Input_new_mouse_X != Mouse_X || Input_new_mouse_Y != Mouse_Y)
161
186
Mouse_X=Input_new_mouse_X;
162
187
Mouse_Y=Input_new_mouse_Y;
164
Set_mouse_position();
166
189
Mouse_K=Input_new_mouse_K;
167
Compute_paintbrush_coordinates();
171
if (Mouse_count>Config.Mouse_merge_movement)
191
if (Mouse_moved > Config.Mouse_merge_movement)
192
if (! Operation[Current_operation][Mouse_K_unique]
193
[Operation_stack_size].Fast_mouse)
197
Set_mouse_position();
327
351
Directional_right=1;
330
else if(Is_shortcut(Key,SPECIAL_CLICK_LEFT))
354
else if(Is_shortcut(Key,SPECIAL_CLICK_LEFT) && Keyboard_click_allowed > 0)
332
356
Input_new_mouse_K=1;
333
358
return Move_cursor_with_constraints();
335
else if(Is_shortcut(Key,SPECIAL_CLICK_RIGHT))
360
else if(Is_shortcut(Key,SPECIAL_CLICK_RIGHT) && Keyboard_click_allowed > 0)
337
362
Input_new_mouse_K=2;
338
364
return Move_cursor_with_constraints();
345
371
int Release_control(int key_code, int modifier)
348
if(key_code == (Config_Key[SPECIAL_MOUSE_UP][0]&0x0FFF) || (Config_Key[SPECIAL_MOUSE_UP][0]&modifier) ||
349
key_code == (Config_Key[SPECIAL_MOUSE_UP][1]&0x0FFF) || (Config_Key[SPECIAL_MOUSE_UP][1]&modifier))
373
int need_feedback = 0;
375
if (modifier == MOD_SHIFT)
377
// Disable "snap axis" mode
382
if((key_code && key_code == (Config_Key[SPECIAL_MOUSE_UP][0]&0x0FFF)) || (Config_Key[SPECIAL_MOUSE_UP][0]&modifier) ||
383
(key_code && key_code == (Config_Key[SPECIAL_MOUSE_UP][1]&0x0FFF)) || (Config_Key[SPECIAL_MOUSE_UP][1]&modifier))
351
385
Directional_up=0;
353
if(key_code == (Config_Key[SPECIAL_MOUSE_DOWN][0]&0x0FFF) || (Config_Key[SPECIAL_MOUSE_DOWN][0]&modifier) ||
354
key_code == (Config_Key[SPECIAL_MOUSE_DOWN][1]&0x0FFF) || (Config_Key[SPECIAL_MOUSE_DOWN][1]&modifier))
387
if((key_code && key_code == (Config_Key[SPECIAL_MOUSE_DOWN][0]&0x0FFF)) || (Config_Key[SPECIAL_MOUSE_DOWN][0]&modifier) ||
388
(key_code && key_code == (Config_Key[SPECIAL_MOUSE_DOWN][1]&0x0FFF)) || (Config_Key[SPECIAL_MOUSE_DOWN][1]&modifier))
356
390
Directional_down=0;
358
if(key_code == (Config_Key[SPECIAL_MOUSE_LEFT][0]&0x0FFF) || (Config_Key[SPECIAL_MOUSE_LEFT][0]&modifier) ||
359
key_code == (Config_Key[SPECIAL_MOUSE_LEFT][1]&0x0FFF) || (Config_Key[SPECIAL_MOUSE_LEFT][1]&modifier))
392
if((key_code && key_code == (Config_Key[SPECIAL_MOUSE_LEFT][0]&0x0FFF)) || (Config_Key[SPECIAL_MOUSE_LEFT][0]&modifier) ||
393
(key_code && key_code == (Config_Key[SPECIAL_MOUSE_LEFT][1]&0x0FFF)) || (Config_Key[SPECIAL_MOUSE_LEFT][1]&modifier))
361
395
Directional_left=0;
363
if(key_code == (Config_Key[SPECIAL_MOUSE_RIGHT][0]&0x0FFF) || (Config_Key[SPECIAL_MOUSE_RIGHT][0]&modifier) ||
364
key_code == (Config_Key[SPECIAL_MOUSE_RIGHT][1]&0x0FFF) || (Config_Key[SPECIAL_MOUSE_RIGHT][1]&modifier))
397
if((key_code && key_code == (Config_Key[SPECIAL_MOUSE_RIGHT][0]&0x0FFF)) || (Config_Key[SPECIAL_MOUSE_RIGHT][0]&modifier) ||
398
(key_code && key_code == (Config_Key[SPECIAL_MOUSE_RIGHT][1]&0x0FFF)) || (Config_Key[SPECIAL_MOUSE_RIGHT][1]&modifier))
366
400
Directional_right=0;
368
if(key_code == (Config_Key[SPECIAL_CLICK_LEFT][0]&0x0FFF) || (Config_Key[SPECIAL_CLICK_LEFT][0]&modifier) ||
369
key_code == (Config_Key[SPECIAL_CLICK_LEFT][1]&0x0FFF) || (Config_Key[SPECIAL_CLICK_LEFT][1]&modifier))
402
if((key_code && key_code == (Config_Key[SPECIAL_CLICK_LEFT][0]&0x0FFF)) || (Config_Key[SPECIAL_CLICK_LEFT][0]&modifier) ||
403
(key_code && key_code == (Config_Key[SPECIAL_CLICK_LEFT][1]&0x0FFF)) || (Config_Key[SPECIAL_CLICK_LEFT][1]&modifier))
371
Input_new_mouse_K &= ~1;
372
return Move_cursor_with_constraints();
405
if (Directional_click & 1)
407
Directional_click &= ~1;
408
Input_new_mouse_K &= ~1;
409
return Move_cursor_with_constraints() || need_feedback;
374
if(key_code == (Config_Key[SPECIAL_CLICK_RIGHT][0]&0x0FFF) || (Config_Key[SPECIAL_CLICK_RIGHT][0]&modifier) ||
375
key_code == (Config_Key[SPECIAL_CLICK_RIGHT][1]&0x0FFF) || (Config_Key[SPECIAL_CLICK_RIGHT][1]&modifier))
412
if((key_code && key_code == (Config_Key[SPECIAL_CLICK_RIGHT][0]&0x0FFF)) || (Config_Key[SPECIAL_CLICK_RIGHT][0]&modifier) ||
413
(key_code && key_code == (Config_Key[SPECIAL_CLICK_RIGHT][1]&0x0FFF)) || (Config_Key[SPECIAL_CLICK_RIGHT][1]&modifier))
377
Input_new_mouse_K &= ~2;
378
return Move_cursor_with_constraints();
415
if (Directional_click & 2)
417
Directional_click &= ~2;
418
Input_new_mouse_K &= ~2;
419
return Move_cursor_with_constraints() || need_feedback;
381
423
// Other keys don't need to be released : they are handled as "events" and procesed only once.
382
424
// These clicks are apart because they need to be continuous (ie move while key pressed)
383
425
// We are relying on "hardware" keyrepeat to achieve that.
426
return need_feedback;
737
// Vidage de toute mise � jour de l'affichage � l'�cran qui serait encore en attente.
738
// (c'est fait ici car on est sur que cette function est apell�e partout ou on a besoin d'interragir avec l'utilisateur)
781
// If the cursor was moved since last update,
782
// it was erased, so we need to redraw it (with the preview brush)
785
Compute_paintbrush_coordinates();
788
// Commit any pending screen update.
789
// This is done in this function because it's called after reading
741
return user_feedback_required;
794
return (Mouse_moved!=0) || user_feedback_required;
744
797
void Adjust_mouse_sensitivity(word fullscreen)