Browse Source

Add Pointer class

This class is a wrapper around xinput results. At this point it has
common attributes (name, id, master/slave).
pull/2/head
Ali Hatami Tajik 2 years ago
parent
commit
bc14590858
  1. 38
      src/scripts/python/xutil/pointer.py

38
src/scripts/python/xutil/pointer.py

@ -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…
Cancel
Save