[WM_ROT] Fixed floating mode window rotation bug that window doesn't send ROTATION_DO...
[platform/core/uifw/e17.git] / src / bin / e_mouse.c
1 #include "e.h"
2
3 EAPI int
4 e_mouse_update(void)
5 {
6    unsigned char map[256] = { 0 };
7    int n;
8
9    if (!ecore_x_pointer_control_set(e_config->mouse_accel_numerator,
10                                     e_config->mouse_accel_denominator,
11                                     e_config->mouse_accel_threshold))
12      return 0;
13
14    if (!ecore_x_pointer_mapping_get(map, 256)) return 0;
15
16    for (n = 0; n < 256; n++)
17      {
18         if (!map[n]) break;
19      }
20    if (n < 3)
21      {
22         map[0] = 1;
23         map[1] = 2;
24         map[2] = 3;
25         n = 3;
26      }
27    if (e_config->mouse_hand == E_MOUSE_HAND_RIGHT)
28      {
29         map[0] = 1;
30         map[2] = 3;
31      }
32    else if (e_config->mouse_hand == E_MOUSE_HAND_LEFT)
33      {
34         map[0] = 3;
35         map[2] = 1;
36      }
37
38    if (!ecore_x_pointer_mapping_set(map, n)) return 0;
39
40    return 1;
41 }