コード例 #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
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)