# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. import os, ctypes, time from ctypes import Structure, POINTER, c_bool, c_int16, c_uint16, c_int32, byref from math import pi, copysign, sqrt from scc.lib.libusb1 import timeval from scc.tools import find_library from scc.cheader import defines from scc.lib import IntEnum UNPUT_MODULE_VERSION = 9 # Get All defines from linux headers if os.path.exists('/usr/include/linux/input-event-codes.h'): CHEAD = defines('/usr/include', 'linux/input-event-codes.h') elif os.path.exists(os.path.split(__file__)[0] + '/input-event-codes.h'): CHEAD = defines(os.path.split(__file__)[0], 'input-event-codes.h') else: CHEAD = defines('/usr/include', 'linux/input.h') MAX_FEEDBACK_EFFECTS = 4 # Keys enum contains all keys and button from linux/uinput.h (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_*) 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_*) Axes = IntEnum('Axes', {i: CHEAD[i] for i in CHEAD.keys() if i.startswith('ABS_')})
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. import os import ctypes import time from math import pi, copysign, sqrt from scc.lib import IntEnum from scc.cheader import defines from scc.tools import find_lib from collections import deque # Get All defines from linux headers if os.path.exists('/usr/include/linux/input-event-codes.h'): CHEAD = defines('/usr/include', 'linux/input-event-codes.h') else: CHEAD = defines('/usr/include', 'linux/input.h') # Keys enum contains all keys and button from linux/uinput.h (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_*) 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_*) 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_*) Rels = IntEnum('Rels', {i: CHEAD[i] for i in CHEAD.keys() if i.startswith('REL_')})
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. import os import ctypes import time from math import pi, copysign, sqrt from scc.lib import IntEnum from scc.cheader import defines from scc.tools import find_lib from collections import deque # Get All defines from linux headers if os.path.exists('/usr/include/linux/input-event-codes.h'): CHEAD = defines('/usr/include', 'linux/input-event-codes.h') else: CHEAD = defines('/usr/include', 'linux/input.h') # Keys enum contains all keys and button from linux/uinput.h (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_*) 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_*)