Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc17f5ce

Browse files
committed
disables evdev mouse driver
1 parentd8a2490 commitc17f5ce

File tree

1 file changed

+109
-106
lines changed
  • api_drivers/common_api_drivers/indev/evdev

1 file changed

+109
-106
lines changed
Lines changed: 109 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
'''
12
# LVGL indev driver for evdev mouse device
23
# (for the unix micropython port)
34
@@ -8,60 +9,54 @@
89
910
import lcd_bus
1011
import pointer_framework
11-
frommicropythonimportconst
12+
from micropython import const # NOQA
1213
import lvgl as lv # NOQA
1314
14-
15-
_REL_X0x00
16-
_REL_Y0x01
17-
_REL_Z0x02
18-
_REL_RX0x03
19-
_REL_RY0x04
20-
_REL_RZ0x05
21-
_REL_HWHEEL0x06
22-
_REL_DIAL0x07
23-
_REL_WHEEL0x08
24-
_REL_WHEEL_HI_RES0x0C
25-
_REL_HWHEEL_HI_RES0x0C
26-
27-
_ABS_X0x00
28-
_ABS_Y0x01
29-
_ABS_Z0x02
30-
_ABS_RX0x03
31-
_ABS_RY0x04
32-
_ABS_RZ0x05
33-
_ABS_THROTTLE0x06
34-
_ABS_RUDDER0x07
35-
_ABS_WHEEL0x08
36-
_ABS_GAS0x09
37-
_ABS_BRAKE0x0a
38-
_ABS_HAT0X0x10
39-
_ABS_HAT0Y0x11
40-
_ABS_HAT1X0x12
41-
_ABS_HAT1Y0x13
42-
_ABS_HAT2X0x14
43-
_ABS_HAT2Y0x15
44-
_ABS_HAT3X0x16
45-
_ABS_HAT3Y0x17
46-
_ABS_PRESSURE0x18
47-
_ABS_DISTANCE0x19
48-
_ABS_TILT_X0x1a
49-
_ABS_TILT_Y0x1b
50-
_ABS_TOOL_WIDTH0x1c
51-
_ABS_VOLUME0x20
52-
_ABS_PROFILE0x21
53-
54-
_ABS_MT_POSITION_X0x35/*CenterXtouchposition*/
55-
_ABS_MT_POSITION_Y0x36/*CenterYtouchposition*/
56-
_ABS_MT_TOOL_TYPE0x37/*Typeoftouchingdevice*/
57-
_ABS_MT_TOOL_X0x3c/*CenterXtoolposition*/
58-
_ABS_MT_TOOL_Y0x3d/*CenterYtoolposition*/
59-
60-
61-
62-
63-
64-
15+
#
16+
# _REL_X0x00
17+
# _REL_Y0x01
18+
# _REL_Z0x02
19+
# _REL_RX0x03
20+
# _REL_RY0x04
21+
# _REL_RZ0x05
22+
# _REL_HWHEEL0x06
23+
# _REL_DIAL0x07
24+
# _REL_WHEEL0x08
25+
# _REL_WHEEL_HI_RES0x0C
26+
# _REL_HWHEEL_HI_RES0x0C
27+
#
28+
# _ABS_X0x00
29+
# _ABS_Y0x01
30+
# _ABS_Z0x02
31+
# _ABS_RX0x03
32+
# _ABS_RY0x04
33+
# _ABS_RZ0x05
34+
# _ABS_THROTTLE0x06
35+
# _ABS_RUDDER0x07
36+
# _ABS_WHEEL0x08
37+
# _ABS_GAS0x09
38+
# _ABS_BRAKE0x0a
39+
# _ABS_HAT0X0x10
40+
# _ABS_HAT0Y0x11
41+
# _ABS_HAT1X0x12
42+
# _ABS_HAT1Y0x13
43+
# _ABS_HAT2X0x14
44+
# _ABS_HAT2Y0x15
45+
# _ABS_HAT3X0x16
46+
# _ABS_HAT3Y0x17
47+
# _ABS_PRESSURE0x18
48+
# _ABS_DISTANCE0x19
49+
# _ABS_TILT_X0x1a
50+
# _ABS_TILT_Y0x1b
51+
# _ABS_TOOL_WIDTH0x1c
52+
# _ABS_VOLUME0x20
53+
# _ABS_PROFILE0x21
54+
#
55+
# _ABS_MT_POSITION_X0x35/* Center X touch position */
56+
# _ABS_MT_POSITION_Y0x36/* Center Y touch position */
57+
# _ABS_MT_TOOL_TYPE0x37/* Type of touching device */
58+
# _ABS_MT_TOOL_X0x3c/* Center X tool position */
59+
# _ABS_MT_TOOL_Y0x3d/* Center Y tool position */
6560
6661
6762
class EvdevMouseDriver(pointer_framework.PointerDriver):
@@ -73,67 +68,73 @@ def __init__(self, device):
7368
super().__init__()
7469
7570
def _get_key(self, _, data):
76-
BTN_RIGHT
77-
BTN_MIDDLE
78-
BTN_SIDE
79-
BTN_EXTRA
80-
BTN_FORWARD
81-
BTN_BACK
82-
BTN_TASK
71+
# BTN_RIGHT
72+
# BTN_MIDDLE
73+
# BTN_SIDE
74+
# BTN_EXTRA
75+
# BTN_FORWARD
76+
# BTN_BACK
77+
# BTN_TASK
78+
pass
8379
8480
8581
def _get_wheel(self, _, data):
86-
REL_HWHEEL
87-
REL_WHEEL
88-
89-
REL_WHEEL_HI_RES
90-
REL_HWHEEL_HI_RES
82+
# REL_HWHEEL
83+
# REL_WHEEL
84+
#
85+
# REL_WHEEL_HI_RES
86+
# REL_HWHEEL_HI_RES
87+
pass
9188
9289
def _get_coords(self):
93-
event=self.device.read()
94-
95-
ifeventisNone:
96-
returnNone
97-
98-
ifevent.type==_EV_KEY:
99-
key=event.code
100-
state=event.code
101-
102-
elifevent.type==_EV_REL:
103-
104-
pos=event.value
105-
106-
ifnotself._poll.poll()[0][1]&select.POLLIN:
107-
returnNone
108-
109-
EV_KEY
110-
BTN_LEFT
111-
REL_X
112-
REL_Y
113-
114-
if (mouse_data[0]&1)!=1:
115-
returnNone
116-
117-
# Data is relative, update coordinates
118-
x=self._last_mouse_x
119-
y=self._last_mouse_y
120-
121-
x+=mouse_data[1]
122-
y-=mouse_data[2]
123-
124-
# Handle coordinate overflow cases
125-
x=max(min(x,self.get_width()-1),0)
126-
y=max(min(y,self.get_height()-1),0)
127-
128-
# Draw cursor, if needed
129-
130-
returnstate,x,y
90+
# event = self.device.read()
91+
#
92+
# if event is None:
93+
# return None
94+
#
95+
# if event.type == _EV_KEY:
96+
# key = event.code
97+
# state = event.code
98+
#
99+
# elif event.type == _EV_REL:
100+
#
101+
# pos = event.value
102+
#
103+
# if not self._poll.poll()[0][1] & select.POLLIN:
104+
# return None
105+
#
106+
# EV_KEY
107+
# BTN_LEFT
108+
# REL_X
109+
# REL_Y
110+
#
111+
# if (mouse_data[0] & 1) != 1:
112+
# return None
113+
#
114+
# # Data is relative, update coordinates
115+
# x = self._last_mouse_x
116+
# y = self._last_mouse_y
117+
#
118+
# x += mouse_data[1]
119+
# y -= mouse_data[2]
120+
#
121+
# # Handle coordinate overflow cases
122+
# x = max(min(x, self.get_width() - 1), 0)
123+
# y = max(min(y, self.get_height() - 1), 0)
124+
#
125+
# # Draw cursor, if needed
126+
#
127+
# return state, x, y
128+
129+
pass
131130
132131
def delete(self):
133-
self._evdev.close()
134-
ifself.cursorandhasattr(self.cursor,'delete'):
135-
self.cursor.delete()
136-
self._indev_drv.enable(False)
132+
# self._evdev.close()
133+
# if self.cursor and hasattr(self.cursor, 'delete'):
134+
# self.cursor.delete()
135+
# self._indev_drv.enable(False)
136+
pass
137+
137138
138139
139140
# evdev driver for mouse
@@ -178,3 +179,5 @@ def delete(self):
178179
if self.cursor and hasattr(self.cursor, 'delete'):
179180
self.cursor.delete()
180181
self._indev_drv.enable(False)
182+
183+
'''

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp