Skip to content

SW_DevKeyPad

Rolf Obrecht edited this page Jun 21, 2023 · 2 revisions

SW_DevKeyPad

Description

This module lets you connect a numerical USB keypad to piTelex in order to simplify the input of e.g. command sequences. The keys can be freely programmed via config file options. Mostly intended for testing purposes.

Requirements/Limitations

Works only for Linux.
Requires python module python3-evdev

Command line arguments

None

Config file parameters

Param type default Description
device_name string none part of device name to select a special keyboard/keypad device
show_key_name true/false true show key names
KEYS dictionary none Dictionary of key values, consists of the following keys: KEY_KP[[0..9]|DOT|PLUS|MINUS|ASTERISK|SLASH|ENTER]

Example config file section

      # Module type "KeyPad"
        # USB-KeyPad input for text shortcuts and test teletypes
        # requirements: evdev (apt install python3-evdev)
    
        "KeyPad1": {
          "type": "KeyPad", 
          "enable": false, 
          "device_name": "KEYPAD",     # part of device name to select a special keyboard/keypad device
          "show_key_name": true,
          "KEYS": { 
            "KEY_KP0": " ",
            "KEY_KP1": "RY",
            "KEY_KP2": "RYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRYRY",
            "KEY_KP3": "",
            "KEY_KP4": "{ABC}",        # ESC-ABC -> text: "abcdefghijklmnopqrstuvwxyz1234567890"
            "KEY_KP5": "{FOX}",        # ESC-FOX -> text: "the quick brown fox jumps over the lazy dog"
            "KEY_KP6": "{PELZE}",
            "KEY_KP7": "{A1}",
            "KEY_KP8": "{TEST}",
            "KEY_KP9": "{LOREM}",
            "KEY_KPDOT>": "#",         # WRU
            "KEY_KPPLUS": "{A}",       # ESC-A -> online mode
            "KEY_KPMINUS": "{Z}",      # ESC-Z -> offline mode
            "KEY_KPASTERISK": "{WB}",  # ESC-WB -> ready for dialing
            "KEY_KPSLASH>": "{ZZ}",    # ESC-ZZ -> sleep mode
            "KEY_KPENTER": "\\_"       # <CR> <LF>
          }
        },
Clone this wiki locally