IT. Expert System.

Android Reference

Keyboard.Key


android.inputmethodservice

Class Keyboard.Key

  • Enclosing class:
    Keyboard


    public static class Keyboard.Key
    extends Object
    Class for describing the position and characteristics of a single key in the keyboard.
    • Field Summary

      Fields
      Modifier and Type Field and Description
      int[] codes
      All the key codes (unicode or custom code) that this key could generate, zero'th being the most important.
      int edgeFlags
      Flags that specify the anchoring to edges of the keyboard for detecting touch events that are just out of the boundary of the key.
      int gap
      The horizontal gap before this key
      int height
      Height of the key, not including the gap
      Drawable icon
      Icon to display instead of a label.
      Drawable iconPreview
      Preview version of the icon, for the preview popup
      CharSequence label
      Label to display
      boolean modifier
      Whether this is a modifier key, such as Shift or Alt
      boolean on
      If this is a sticky key, is it on?
      CharSequence popupCharacters
      Popup characters
      int popupResId
      If this key pops up a mini keyboard, this is the resource id for the XML layout for that keyboard.
      boolean pressed
      The current pressed state of this key
      boolean repeatable
      Whether this key repeats itself when held down
      boolean sticky
      Whether this key is sticky, i.e., a toggle key
      CharSequence text
      Text to output when pressed.
      int width
      Width of the key, not including the gap
      int x
      X coordinate of the key in the keyboard layout
      int y
      Y coordinate of the key in the keyboard layout
    • Field Detail

      • codes

        public int[] codes
        All the key codes (unicode or custom code) that this key could generate, zero'th being the most important.
      • icon

        public Drawable icon
        Icon to display instead of a label. Icon takes precedence over a label
      • iconPreview

        public Drawable iconPreview
        Preview version of the icon, for the preview popup
      • width

        public int width
        Width of the key, not including the gap
      • height

        public int height
        Height of the key, not including the gap
      • gap

        public int gap
        The horizontal gap before this key
      • sticky

        public boolean sticky
        Whether this key is sticky, i.e., a toggle key
      • x

        public int x
        X coordinate of the key in the keyboard layout
      • y

        public int y
        Y coordinate of the key in the keyboard layout
      • pressed

        public boolean pressed
        The current pressed state of this key
      • on

        public boolean on
        If this is a sticky key, is it on?
      • text

        public CharSequence text
        Text to output when pressed. This can be multiple characters, like ".com"
      • popupCharacters

        public CharSequence popupCharacters
        Popup characters
      • modifier

        public boolean modifier
        Whether this is a modifier key, such as Shift or Alt
      • popupResId

        public int popupResId
        If this key pops up a mini keyboard, this is the resource id for the XML layout for that keyboard.
      • repeatable

        public boolean repeatable
        Whether this key repeats itself when held down
    • Constructor Detail

      • Keyboard.Key

        public Keyboard.Key(Keyboard.Row parent)
        Create an empty key with no attributes.
      • Keyboard.Key

        public Keyboard.Key(Resources res,
                    Keyboard.Row parent,
                    int x,
                    int y,
                    XmlResourceParser parser)
        Create a key with the given top-left coordinate and extract its attributes from the XML parser.
        Parameters:
        res - resources associated with the caller's context
        parent - the row that this key belongs to. The row must already be attached to a Keyboard.
        x - the x coordinate of the top-left
        y - the y coordinate of the top-left
        parser - the XML parser containing the attributes for this key
    • Method Detail

      • onPressed

        public void onPressed()
        Informs the key that it has been pressed, in case it needs to change its appearance or state.
        See Also:
        onReleased(boolean)
      • onReleased

        public void onReleased(boolean inside)
        Changes the pressed state of the key. If it is a sticky key, it will also change the toggled state of the key if the finger was release inside.
        Parameters:
        inside - whether the finger was released inside the key
        See Also:
        onPressed()
      • isInside

        public boolean isInside(int x,
                       int y)
        Detects if a point falls inside this key.
        Parameters:
        x - the x-coordinate of the point
        y - the y-coordinate of the point
        Returns:
        whether or not the point falls inside the key. If the key is attached to an edge, it will assume that all points between the key and the edge are considered to be inside the key.
      • squaredDistanceFrom

        public int squaredDistanceFrom(int x,
                              int y)
        Returns the square of the distance between the center of the key and the given point.
        Parameters:
        x - the x-coordinate of the point
        y - the y-coordinate of the point
        Returns:
        the square of the distance of the point from the center of the key
      • getCurrentDrawableState

        public int[] getCurrentDrawableState()
        Returns the drawable state for the key, based on the current state and type of the key.
        Returns:
        the drawable state of the key.
        See Also:
        Drawable.setState(int[])


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 674 / 158857737. Delta: 0.04052 с