Example #1
0
def main():
    device = usb_and_keyboard_device_init.init_uinput_device()

    time.sleep(1)
    gkey_functionality.g1(device)
    gkey_functionality.g2(device)
Example #2
0
from lib.uinput_keyboard import keyboard
import time
from lib.keyboard_initialization import usb_and_keyboard_device_init

device = usb_and_keyboard_device_init.init_uinput_device()
time.sleep(1)
layout = "fr"


def shortcut(string):
    keyboard.shortcut(string, layout, device)
    keyboard.release(device)
    time.sleep(0.5)
    if len(keyboard.press_release_fifo):
        print("PRESS_RELEASE_FIFO is not empty!")


def writeout(string):
    keyboard.writeout(string, layout, device)
    time.sleep(0.5)


string = " ²&é\"'(-è_çà)=0123456789~#{[|`\\^@]}aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ^¨$£øù%*µ,?;.:/!§\t\n"
path = "/tmp/test_g910.txt"
shortcut("ctrl+alt+t")
writeout("rm " + path + "\n")
writeout("vim " + path + "\n")
writeout("i" + string)
shortcut("capslock+a,a,capslock+a,a")
print("pressing esc")
time.sleep(5)