Skip to content

Commit

Permalink
fix: avoid crashes on daemon start
Browse files Browse the repository at this point in the history
  • Loading branch information
git-developer committed Sep 21, 2024
1 parent 6e56dc2 commit c8d0319
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
1 change: 0 additions & 1 deletion scc/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import sys
import token as TokenType
from enum import EnumType
from tokenize import TokenError, generate_tokens
from typing import NamedTuple

Expand Down
12 changes: 4 additions & 8 deletions scc/uinput.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,16 @@
MAX_FEEDBACK_EFFECTS = 4

# Keys enum contains all keys and button from linux/uinput.h (KEY_* BTN_*)
class Keys(IntEnum):
locals().update({i: CHEAD[i] for i in CHEAD if i.startswith(("KEY_", "BTN_"))})
Keys = IntEnum('Keys', {i: CHEAD[i] for i in CHEAD.keys() if (i.startswith('KEY_') or i.startswith('BTN_'))})

# Keys enum contains all keys and button from linux/uinput.h (KEY_* BTN_*)
class KeysOnly(IntEnum):
locals().update({i: CHEAD[i] for i in CHEAD if i.startswith("KEY_")})
KeysOnly = IntEnum('KeysOnly', {i: CHEAD[i] for i in CHEAD.keys() if i.startswith('KEY_')})

# Axes enum contains all axes from linux/uinput.h (ABS_*)
class Axes(IntEnum):
locals().update({i: CHEAD[i] for i in CHEAD if i.startswith("ABS_")})
Axes = IntEnum('Axes', {i: CHEAD[i] for i in CHEAD.keys() if i.startswith('ABS_')})

# Rels enum contains all rels from linux/uinput.h (REL_*)
class Rels(IntEnum):
locals().update({i: CHEAD[i] for i in CHEAD if i.startswith("REL_")})
Rels = IntEnum('Rels', {i: CHEAD[i] for i in CHEAD.keys() if i.startswith('REL_')})

# Scan codes for each keys (taken from a logitech keyboard)
Scans = {
Expand Down

0 comments on commit c8d0319

Please sign in to comment.