Skip navigation links
org.vishia.util

Class KeyCode

    • Constructor Detail

      • KeyCode

        public KeyCode(java.lang.String src)
      • KeyCode

        public KeyCode(int code)
    • Method Detail

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • convert

        public static int convert(java.lang.String src)
      • isWritingKey

        public static boolean isWritingKey(int key)
        A key which is used in an text field to write something. It includes the del key.
        Parameters:
        key -
        Returns:
      • isAsciiTextKey

        public static boolean isAsciiTextKey(int key)
        Any key between the codes 0x20 .. 0x7e, it is an ASCII text key.
        Parameters:
        key -
        Returns:
      • isTextKey

        public static boolean isTextKey(int key)
        Any text key, in UTF16 range but not a ASCII control key (0x0 .. 0x1f)
        Parameters:
        key -
        Returns:
      • isControlOrFunction

        public static boolean isControlOrFunction(int key)
        returns true if it is a control or function key. Either function or ctrl combination. A control key controls actions of the user. The original control keys in the 1960-80 age were associated with the control key button. On PCs the function keys enhances this concept. Usual keys with ctrl-button and all function keys maybe in combination with ctrl, shift, alt are used for user-control of an application via keyboard. This combinations returns true.
        A alphanumeric key only in combination with alt is not a control key. It is intended for menu actions.
        Parameters:
        key -
        Returns:
      • isControlFunctionMouseUpOrMenu

        public static boolean isControlFunctionMouseUpOrMenu(int key)
        Returns true if it is a control, function or graphical control key. It supports the typical situation for an action which should be invoked by a control or function key from the keyboard or only on mouse-up in any widget, or from an menu click. Usual a graphical button should act on mouse-up, not on mouse-down. That is because on touch screen a mouse down shows maybe a fault position or fault button activation. If the cursor will be move away, the button is not activated.
        Parameters:
        key -
        Returns:
      • isWritingOrTextNavigationKey

        public static boolean isWritingOrTextNavigationKey(int key)