mini-arcade-native-backend 0.4.1__cp310-cp310-win_amd64.whl → 0.4.2__cp310-cp310-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mini_arcade_native_backend/__init__.py +49 -21
- mini_arcade_native_backend/_native.cp310-win_amd64.pyd +0 -0
- {mini_arcade_native_backend-0.4.1.dist-info → mini_arcade_native_backend-0.4.2.dist-info}/METADATA +1 -1
- mini_arcade_native_backend-0.4.2.dist-info/RECORD +6 -0
- mini_arcade_native_backend-0.4.1.dist-info/RECORD +0 -6
- {mini_arcade_native_backend-0.4.1.dist-info → mini_arcade_native_backend-0.4.2.dist-info}/WHEEL +0 -0
- {mini_arcade_native_backend-0.4.1.dist-info → mini_arcade_native_backend-0.4.2.dist-info}/licenses/LICENSE +0 -0
|
@@ -37,6 +37,7 @@ if sys.platform == "win32":
|
|
|
37
37
|
# Justification: Need to import core after setting DLL path on Windows
|
|
38
38
|
# pylint: disable=wrong-import-position
|
|
39
39
|
from mini_arcade_core import Backend, Event, EventType
|
|
40
|
+
from mini_arcade_core.keymaps.sdl import SDL_KEYCODE_TO_KEY
|
|
40
41
|
|
|
41
42
|
# Justification: Importing the native extension module
|
|
42
43
|
# pylint: disable=import-self,no-name-in-module
|
|
@@ -127,34 +128,64 @@ class NativeBackend(Backend):
|
|
|
127
128
|
for ev in self._engine.poll_events():
|
|
128
129
|
etype = _NATIVE_TO_CORE.get(ev.type, EventType.UNKNOWN)
|
|
129
130
|
|
|
130
|
-
|
|
131
|
-
|
|
131
|
+
key = None
|
|
132
|
+
key_code = None
|
|
133
|
+
scancode = None
|
|
134
|
+
mod = None
|
|
135
|
+
repeat = None
|
|
136
|
+
|
|
137
|
+
x = y = dx = dy = None
|
|
138
|
+
button = None
|
|
139
|
+
wheel = None
|
|
140
|
+
size = None
|
|
141
|
+
text = None
|
|
142
|
+
|
|
143
|
+
if etype in (EventType.KEYDOWN, EventType.KEYUP):
|
|
144
|
+
raw_key = int(getattr(ev, "key", 0) or 0)
|
|
145
|
+
key_code = raw_key if raw_key != 0 else None
|
|
146
|
+
key = SDL_KEYCODE_TO_KEY.get(raw_key) if raw_key != 0 else None
|
|
147
|
+
|
|
148
|
+
scancode = (
|
|
149
|
+
int(ev.scancode) if getattr(ev, "scancode", 0) else None
|
|
150
|
+
)
|
|
151
|
+
mod = int(ev.mod) if getattr(ev, "mod", 0) else None
|
|
152
|
+
|
|
153
|
+
rep = int(getattr(ev, "repeat", 0) or 0)
|
|
154
|
+
repeat = bool(rep) if etype == EventType.KEYDOWN else None
|
|
132
155
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
156
|
+
elif etype == EventType.MOUSEMOTION:
|
|
157
|
+
x = int(ev.x)
|
|
158
|
+
y = int(ev.y)
|
|
159
|
+
dx = int(ev.dx)
|
|
160
|
+
dy = int(ev.dy)
|
|
138
161
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
162
|
+
elif etype in (EventType.MOUSEBUTTONDOWN, EventType.MOUSEBUTTONUP):
|
|
163
|
+
button = int(ev.button) if ev.button else None
|
|
164
|
+
x = int(ev.x)
|
|
165
|
+
y = int(ev.y)
|
|
142
166
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
167
|
+
elif etype == EventType.MOUSEWHEEL:
|
|
168
|
+
wx = int(ev.wheel_x)
|
|
169
|
+
wy = int(ev.wheel_y)
|
|
170
|
+
wheel = (wx, wy) if (wx or wy) else None
|
|
146
171
|
|
|
147
|
-
|
|
172
|
+
elif etype == EventType.WINDOWRESIZED:
|
|
173
|
+
w = int(ev.width)
|
|
174
|
+
h = int(ev.height)
|
|
175
|
+
size = (w, h) if (w and h) else None
|
|
148
176
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
repeat = bool(repeat_raw) if repeat_raw else None
|
|
177
|
+
elif etype == EventType.TEXTINPUT:
|
|
178
|
+
t = getattr(ev, "text", "")
|
|
179
|
+
text = t if t else None
|
|
153
180
|
|
|
154
181
|
out.append(
|
|
155
182
|
Event(
|
|
156
183
|
type=etype,
|
|
157
184
|
key=key,
|
|
185
|
+
key_code=key_code,
|
|
186
|
+
scancode=scancode,
|
|
187
|
+
mod=mod,
|
|
188
|
+
repeat=repeat,
|
|
158
189
|
x=x,
|
|
159
190
|
y=y,
|
|
160
191
|
dx=dx,
|
|
@@ -163,9 +194,6 @@ class NativeBackend(Backend):
|
|
|
163
194
|
wheel=wheel,
|
|
164
195
|
size=size,
|
|
165
196
|
text=text,
|
|
166
|
-
scancode=scancode,
|
|
167
|
-
mod=mod,
|
|
168
|
-
repeat=repeat,
|
|
169
197
|
)
|
|
170
198
|
)
|
|
171
199
|
return out
|
|
Binary file
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
mini_arcade_native_backend/__init__.py,sha256=R6N7QYH4Ez6mmZOtdJd3UcPqo4obAW9um7w9Hjsrv6o,9609
|
|
2
|
+
mini_arcade_native_backend/_native.cp310-win_amd64.pyd,sha256=1qDu9CQPieZR6065PjhDQUVV1JwhJtVnmwxBqcjG4L8,212480
|
|
3
|
+
mini_arcade_native_backend-0.4.2.dist-info/METADATA,sha256=9xVRtkbI96F7nljlKYgChuP6Au-z1jA6-pAhteCitOk,10517
|
|
4
|
+
mini_arcade_native_backend-0.4.2.dist-info/WHEEL,sha256=hrGeChGtn46HBGmzasO9QQDSLelRN-tUarBSv4gFcsI,106
|
|
5
|
+
mini_arcade_native_backend-0.4.2.dist-info/licenses/LICENSE,sha256=cZRgTdRJ3YASekMxkGAvylB2nROh4ov228DxAogK3yY,1115
|
|
6
|
+
mini_arcade_native_backend-0.4.2.dist-info/RECORD,,
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
mini_arcade_native_backend/__init__.py,sha256=CISb6F09IyBc8xg5gEoiG5hUgBjCSOtkw-4SNNzQMLM,8699
|
|
2
|
-
mini_arcade_native_backend/_native.cp310-win_amd64.pyd,sha256=K4A__UwqSLkrx7YRmE3mw2xMgfYZlZBwbucB9ypPmVg,212480
|
|
3
|
-
mini_arcade_native_backend-0.4.1.dist-info/METADATA,sha256=Ar02qqV_fKEgajUC3fF4DNOU2_xhRf8ZqiaNEDukyN8,10517
|
|
4
|
-
mini_arcade_native_backend-0.4.1.dist-info/WHEEL,sha256=hrGeChGtn46HBGmzasO9QQDSLelRN-tUarBSv4gFcsI,106
|
|
5
|
-
mini_arcade_native_backend-0.4.1.dist-info/licenses/LICENSE,sha256=cZRgTdRJ3YASekMxkGAvylB2nROh4ov228DxAogK3yY,1115
|
|
6
|
-
mini_arcade_native_backend-0.4.1.dist-info/RECORD,,
|
{mini_arcade_native_backend-0.4.1.dist-info → mini_arcade_native_backend-0.4.2.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|