|
|
@ -1,6 +1,7 @@ |
|
|
|
import xutil.common as com |
|
|
|
import re |
|
|
|
|
|
|
|
|
|
|
|
class XInput: |
|
|
|
"""Base XInput class |
|
|
|
|
|
|
@ -25,7 +26,7 @@ class XInput: |
|
|
|
|
|
|
|
class Pointer(XInput): |
|
|
|
"""Pointer class |
|
|
|
|
|
|
|
|
|
|
|
This class is a wrapper around xinput commandline --list output. |
|
|
|
|
|
|
|
|
|
|
@ -36,6 +37,7 @@ class Pointer(XInput): |
|
|
|
def __init__(self, name, id, is_master: bool) -> None: |
|
|
|
super().__init__(name, id, is_master) |
|
|
|
|
|
|
|
|
|
|
|
def get_short_pointer(id) -> Pointer: |
|
|
|
"""Generates Pointer object corresponding to id (short attrs) |
|
|
|
|
|
|
@ -54,7 +56,7 @@ def get_short_pointer(id) -> Pointer: |
|
|
|
if "pointer" in props: |
|
|
|
is_master = "master" in props |
|
|
|
return Pointer( |
|
|
|
name.strip(), |
|
|
|
name.strip(), |
|
|
|
props.split(maxsplit=1), |
|
|
|
is_master) |
|
|
|
else: |
|
|
@ -63,7 +65,7 @@ def get_short_pointer(id) -> Pointer: |
|
|
|
|
|
|
|
def get_pointers(is_short=True): |
|
|
|
"""Wraps pointers in `xinput --list` in Pointer class |
|
|
|
|
|
|
|
|
|
|
|
Creation of the pointer is done by getting the list description of |
|
|
|
each id. if the is_short arg is True, then short list description will be |
|
|
|
used which will provide the class `name`, `is_master` and `id` values. |
|
|
|