Browse Source
This class is a wrapper around xinput results. At this point it has common attributes (name, id, master/slave).pull/2/head
1 changed files with 38 additions and 0 deletions
@ -0,0 +1,38 @@ |
|||
import xutil.common as com |
|||
import re |
|||
|
|||
class XInput: |
|||
"""Base XInput class |
|||
|
|||
Attributes: |
|||
name (str): name of the input |
|||
id (int): id of the input |
|||
is_master (bool): True if device is master |
|||
""" |
|||
|
|||
def __init__(self, name, id, is_master) -> None: |
|||
"""Initializes the class with name, id and master status |
|||
|
|||
Args: |
|||
name (str): name of the input. No processing is done on the name |
|||
id (int): id of the input |
|||
is_master (bool): master status of the input device |
|||
""" |
|||
self.name = name |
|||
self.id = id |
|||
self.is_master = is_master |
|||
|
|||
|
|||
class Pointer(XInput): |
|||
"""Pointer class |
|||
|
|||
This class is a wrapper around xinput commandline --list output. |
|||
|
|||
|
|||
Attrs: |
|||
is_master (bool): True if the pointer is a master pointer else False |
|||
""" |
|||
|
|||
def __init__(self, name, id, is_master: bool) -> None: |
|||
super().__init__(name, id, is_master) |
|||
|
Loading…
Reference in new issue