Пример #1
0
def klick(key):
    context = lib.interception_create_context()

    stroke = ffi.new('InterceptionMouseStroke *')

    stroke.state = key
    lib.interception_send(context, 1, stroke, 1)

    lib.interception_destroy_context(context)
Пример #2
0
def mausklick():
    context = lib.interception_create_context()

    stroke = ffi.new('InterceptionMouseStroke *')

    stroke.state = SCANCODE.INTERCEPTION_MOUSE_LEFT_BUTTON_DOWN
    lib.interception_send(context, 11, stroke, 1)
    stroke.state = SCANCODE.INTERCEPTION_MOUSE_LEFT_BUTTON_UP
    lib.interception_send(context, 11, stroke, 1)
    lib.interception_destroy_context(context)
Пример #3
0
def anmelden(benutzer, pw):
    context = lib.interception_create_context()
    kstroke = ffi.new('InterceptionKeyStroke *')

    for key in benutzer:
        kstroke.code = SCANCODE.anmeldedaten[key]
        lib.interception_send(context, 1, kstroke, 1)

    kstroke.code = SCANCODE.TAB
    lib.interception_send(context, 1, kstroke, 1)

    for key in pw:
        kstroke.code = SCANCODE.anmeldedaten[key]
        lib.interception_send(context, 1, kstroke, 1)
Пример #4
0
if __name__ == '__main__':
    import sys

    program_instance = try_open_single_program('407631B6-78D3-4EFC-A868-40BBB7204CF1')
    if not program_instance:
        sys.exit()

    raise_process_priority()

    context = lib.interception_create_context()

    lib.interception_set_filter(context, lib.interception_is_keyboard,
                                lib.INTERCEPTION_FILTER_KEY_DOWN |
                                lib.INTERCEPTION_FILTER_KEY_UP)

    kstroke = ffi.new('InterceptionKeyStroke *')

    while True:
        device = lib.interception_wait(context)
        if not lib.interception_receive(context, device, kstroke, 1):
            break
        kstrokes = caps2esc(kstroke[0])

        if kstrokes:
            lib.interception_send(context, device,
                                  ffi.new('InterceptionKeyStroke []', kstrokes),
                                  len(kstrokes))
    lib.interception_destroy_context(context)
    close_single_program(program_instance)
Пример #5
0
        del_is_down = False

    return True


if __name__ == '__main__':

    raise_process_priority()

    context = lib.interception_create_context()

    lib.interception_set_filter(context, lib.interception_is_keyboard,
                                lib.INTERCEPTION_FILTER_KEY_ALL)

    stroke = ffi.new('InterceptionKeyStroke *')
    while True:
        device = lib.interception_wait(context)
        if not lib.interception_receive(context, device, stroke, 1):
            break

        if not shall_produce_keystroke(stroke):
            print('ctrl-alt-del pressed')
            continue

        lib.interception_send(context, device, stroke, 1)

        if stroke.code == SCANCODE.ESC:
            break

    lib.interception_destroy_context(context)