src/aoikhotkey/hotkey_manager.py
def _hotseq_find_and_call(self, vk, event, propagate=None):
        """
        Find and call key-sequence function.

        :param vk: Current down event's virtual key.

        :param event: Event object.

        :param propagate: Whether propagate the event.

        :return: A two-item tuple.

        Tuple format is:
        (
            Item 0,     # Whether hot-sequence is found.
            Item 1:     # Whether propagate the event.
        )
        """
        # Whether key-sequence is found
        hotseq_is_found = False

        # If the hotkey info map is empty
        if not self._hotkey_info_by_vk_map_for_key_seq:
            # Return result
            return (hotseq_is_found, propagate)

        # Add the virtual key to queue
        self._vk_s_dn_queue.append(vk)

        # Key-sequence's max length
        hotseq_len_max = 0

        # For the map's each key-sequence
        for hotseq, hotkey_info in \
                self._hotkey_info_by_vk_map_for_key_seq.items():
            # Get the key-sequence's length
            hotseq_len = len(hotseq)

            # If the key-sequence's length is GT the max length
            if hotseq_len > hotseq_len_max:
                # Use as max length
                hotseq_len_max = hotseq_len

            # If the key-sequence is triggered
            if self._hotseq_is_triggered(hotseq):
                # Set key-sequence is found
                hotseq_is_found = True

                # Call the key-sequence function
                propagate = self._hotkey_call(
                    hotkey=hotseq,
                    hotkey_type=HOTKEY_TYPE_V_KS,
                    hotkey_info=hotkey_info,
                    event=event,
                    propagate=propagate,
                )

                # Stop finding
                break

        # Get the queue length
        queue_len = len(self._vk_s_dn_queue)

        # Get the queue's extra length compared to key-sequence's max length
        extra_len = queue_len - hotseq_len_max

        # If have extra length,
        # it means the queue has stored more than needed number of virtual
        # keys.
        while extra_len > 0:
            # Pop the first item off the queue
            self._vk_s_dn_queue.popleft()

            # Decrement the extra length
            extra_len -= 1

        # Return the result
        return (hotseq_is_found, propagate)

        Find and call key-sequence function.

        :param vk: Current down event's virtual key.

        :param event: Event object.

        :param propagate: Whether propagate the event.

        :return: A two-item tuple.

        Tuple format is:
        (
            Item 0,     # Whether hot-sequence is found.
            Item 1:     # Whether propagate the event.
        )
        
Find and call key-sequence function.
Find and call key - sequence function .
def _hotseq_find_and_call(self, vk, event, propagate=None):
        hotseq_is_found = False
        if not self._hotkey_info_by_vk_map_for_key_seq:
            return (hotseq_is_found, propagate)
        self._vk_s_dn_queue.append(vk)
        hotseq_len_max = 0
        for hotseq, hotkey_info in \
                self._hotkey_info_by_vk_map_for_key_seq.items():
            hotseq_len = len(hotseq)
            if hotseq_len > hotseq_len_max:
                hotseq_len_max = hotseq_len
            if self._hotseq_is_triggered(hotseq):
                hotseq_is_found = True
                propagate = self._hotkey_call(
                    hotkey=hotseq,
                    hotkey_type=HOTKEY_TYPE_V_KS,
                    hotkey_info=hotkey_info,
                    event=event,
                    propagate=propagate,
                )
                break
        queue_len = len(self._vk_s_dn_queue)
        extra_len = queue_len - hotseq_len_max
        while extra_len > 0:
            self._vk_s_dn_queue.popleft()
            extra_len -= 1
        return (hotseq_is_found, propagate)
def _hotseq_find_and_call ( self , vk , event , propagate = None ) : hotseq_is_found = False if not self . _hotkey_info_by_vk_map_for_key_seq : return ( hotseq_is_found , propagate ) self . _vk_s_dn_queue . append ( vk ) hotseq_len_max = 0 for hotseq , hotkey_info in self . _hotkey_info_by_vk_map_for_key_seq . items ( ) : hotseq_len = len ( hotseq ) if hotseq_len > hotseq_len_max : hotseq_len_max = hotseq_len if self . _hotseq_is_triggered ( hotseq ) : hotseq_is_found = True propagate = self . _hotkey_call ( hotkey = hotseq , hotkey_type = HOTKEY_TYPE_V_KS , hotkey_info = hotkey_info , event = event , propagate = propagate , ) break queue_len = len ( self . _vk_s_dn_queue ) extra_len = queue_len - hotseq_len_max while extra_len > 0 : self . _vk_s_dn_queue . popleft ( ) extra_len -= 1 return ( hotseq_is_found , propagate )
Find and call key-sequence function.
Find and call key - sequence function .
"""
        Find and call key-sequence function.

        :param vk: Current down event's virtual key.

        :param event: Event object.

        :param propagate: Whether propagate the event.

        :return: A two-item tuple.

        Tuple format is:
        (
            Item 0,     # Whether hot-sequence is found.
            Item 1:     # Whether propagate the event.
        )
        """ # Whether key-sequence is found # If the hotkey info map is empty # Return result # Add the virtual key to queue # Key-sequence's max length # For the map's each key-sequence # Get the key-sequence's length # If the key-sequence's length is GT the max length # Use as max length # If the key-sequence is triggered # Set key-sequence is found # Call the key-sequence function # Stop finding # Get the queue length # Get the queue's extra length compared to key-sequence's max length # If have extra length, # it means the queue has stored more than needed number of virtual # keys. # Pop the first item off the queue # Decrement the extra length # Return the result
A two-item tuple.
Tuple format is:
(
Item 0,     # Whether hot-sequence is found.
Item 1:     # Whether propagate the event.
A two - item tuple . Tuple format is : ( Item 0 # Whether hot - sequence is found . Item 1 : # Whether propagate the event .
self
vk
Current down event's virtual key.
Current down event ' s virtual key .
event
None
propagate
Whether propagate the event.
Whether propagate the event .