src/aoikhotkey/util/efunc.py
def efunc(event):
    """
    Event function that prints all events.

    :param event: Event object.

    :return: None.
    """
    # Get hotkey manager
    hotkey_manager = hotkey_manager_get()

    # If given event is mouse event
    if 'mouse' in event.MessageName:
        # Get virtual key from `Message` field
        vk = event.Message

    # If given event is not mouse event
    else:
        # Get virtual key from `KeyID` field
        vk = event.KeyID

    # If given event is mouse wheel event
    if 'mouse wheel' in event.MessageName:
        # Whether mouse wheel is scrolling up
        wheel_up = event.Wheel > 0

        # Get wheel side text
        wheel_side = 'up' if wheel_up else 'down'

    # If given event is not mouse wheel event
    else:
        # Set wheel side text be None
        wheel_side = None

    # Whether is up event
    is_up_event = 'up' in event.MessageName

    # Get currently down virtual key list's text list
    down_vk_text_s = [
        hotkey_manager.vk_to_name(_vk) or str(_vk)
        for _vk in hotkey_manager.vk_down_list()
    ]

    # If is up event
    if is_up_event:
        # Add the event virtual key's text, plus `(-)`
        down_vk_text_s.append(
            (hotkey_manager.vk_to_name(vk) or str(vk)) + '(-)'
        )

    # If is not up event
    else:
        # Add `(+)` to the last virtual key's text
        down_vk_text_s[-1] += '(+)'

    # Get message for the currently down virtual key list
    # E.g. `# LCTRL A(+)`
    msg = '# ' + ' '.join(down_vk_text_s) + '\n'

    # Print message
    sys.stderr.write(msg)

    # Get the event virtual key's name
    vk_name = hotkey_manager.vk_to_name(vk)

    # Get message for event
    msg = (
        'VK={vk} ({vk_hex}) Name={vk_name} Event={msg_name}'
        '{wheel_side}\n\n'
    ).format(
        vk=vk,
        vk_hex=hex(vk),
        vk_name=repr(vk_name if vk_name is not None else ''),
        msg_name=event.MessageName,
        wheel_side=' ' + wheel_side if wheel_side is not None else '',
    )

    # Print message
    sys.stderr.write(msg)

    Event function that prints all events.

    :param event: Event object.

    :return: None.
    
Event function that prints all events.
Event function that prints all events .
def efunc(event):
    hotkey_manager = hotkey_manager_get()
    if 'mouse' in event.MessageName:
        vk = event.Message
    else:
        vk = event.KeyID
    if 'mouse wheel' in event.MessageName:
        wheel_up = event.Wheel > 0
        wheel_side = 'up' if wheel_up else 'down'
    else:
        wheel_side = None
    is_up_event = 'up' in event.MessageName
    down_vk_text_s = [
        hotkey_manager.vk_to_name(_vk) or str(_vk)
        for _vk in hotkey_manager.vk_down_list()
    ]
    if is_up_event:
        down_vk_text_s.append(
            (hotkey_manager.vk_to_name(vk) or str(vk)) + '(-)'
        )
    else:
        down_vk_text_s[-1] += '(+)'
    msg = '# ' + ' '.join(down_vk_text_s) + '\n'
    sys.stderr.write(msg)
    vk_name = hotkey_manager.vk_to_name(vk)
    msg = (
        'VK={vk} ({vk_hex}) Name={vk_name} Event={msg_name}'
        '{wheel_side}\n\n'
    ).format(
        vk=vk,
        vk_hex=hex(vk),
        vk_name=repr(vk_name if vk_name is not None else ''),
        msg_name=event.MessageName,
        wheel_side=' ' + wheel_side if wheel_side is not None else '',
    )
    sys.stderr.write(msg)
def efunc ( event ) : hotkey_manager = hotkey_manager_get ( ) if 'mouse' in event . MessageName : vk = event . Message else : vk = event . KeyID if 'mouse wheel' in event . MessageName : wheel_up = event . Wheel > 0 wheel_side = 'up' if wheel_up else 'down' else : wheel_side = None is_up_event = 'up' in event . MessageName down_vk_text_s = [ hotkey_manager . vk_to_name ( _vk ) or str ( _vk ) for _vk in hotkey_manager . vk_down_list ( ) ] if is_up_event : down_vk_text_s . append ( ( hotkey_manager . vk_to_name ( vk ) or str ( vk ) ) + '(-)' ) else : down_vk_text_s [ - 1 ] += '(+)' msg = '# ' + ' ' . join ( down_vk_text_s ) + '\n' sys . stderr . write ( msg ) vk_name = hotkey_manager . vk_to_name ( vk ) msg = ( 'VK={vk} ({vk_hex}) Name={vk_name} Event={msg_name}' '{wheel_side}\n\n' ) . format ( vk = vk , vk_hex = hex ( vk ) , vk_name = repr ( vk_name if vk_name is not None else '' ) , msg_name = event . MessageName , wheel_side = ' ' + wheel_side if wheel_side is not None else '' , ) sys . stderr . write ( msg )
Event function that prints all events.
Event function that prints all events .
"""
    Event function that prints all events.

    :param event: Event object.

    :return: None.
    """ # Get hotkey manager # If given event is mouse event # Get virtual key from `Message` field # If given event is not mouse event # Get virtual key from `KeyID` field # If given event is mouse wheel event # Whether mouse wheel is scrolling up # Get wheel side text # If given event is not mouse wheel event # Set wheel side text be None # Whether is up event # Get currently down virtual key list's text list # If is up event # Add the event virtual key's text, plus `(-)` # If is not up event # Add `(+)` to the last virtual key's text # Get message for the currently down virtual key list # E.g. `# LCTRL A(+)` # Print message # Get the event virtual key's name # Get message for event # Print message
None
event
None