Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
plushkatze
foobarpay
Commits
5a8ad457
Commit
5a8ad457
authored
Apr 19, 2016
by
anthraxx
Browse files
evdev non-blocking read_one mode
parent
3c47ff9b
Changes
1
Hide whitespace changes
Inline
Side-by-side
foobarpay/scanner.py
View file @
5a8ad457
...
...
@@ -50,7 +50,9 @@ class EvdevScanner(object):
self
.
device
.
grab
()
def
read
(
self
):
for
event
in
self
.
device
.
read_loop
():
for
event
in
self
.
device
.
read_one
():
if
not
event
:
return
None
if
event
.
type
!=
ecodes
.
EV_KEY
or
event
.
value
!=
1
:
return
None
scanned_input
=
self
.
scancodes
.
get
(
event
.
code
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment