public class

AdvancedKeyboard

extends Object
java.lang.Object
   ↳ com.datalogic.device.input.AdvancedKeyboard

Class Overview

Class exposing advanced keyboard methods.

Summary

Nested Classes
interface AdvancedKeyboard.ActionEventListener Interface representing a listener of keyboard action events. 
class AdvancedKeyboard.Configuration Class that stores the configuration related some keyboard parameters. 
class AdvancedKeyboard.Info Class that stores the info related to the installed keyboard configuration. 
interface AdvancedKeyboard.LayoutChangeEventListener Interface representing a listener of keyboard layout change events. 
enum AdvancedKeyboard.LayoutNotificationType Enumerative representing the type of notification to use in order to represent visually the current layout in which the keyboard is. 
interface AdvancedKeyboard.MultitapEventListener Interface representing a listener of keyboard multitap events. 
class AdvancedKeyboard.Overlay Class that stores the info related to a keyboard overlay configuration. 
enum AdvancedKeyboard.PersistenceType Enumerative representing the persistence type of the installed keyboard configuration. 
enum AdvancedKeyboard.Property Read-only properties related to the currently configured keyboard. 
class AdvancedKeyboard.Resources Class that stores the resources related to the installed keyboard configuration. 
Public Methods
boolean addActionEventListener(AdvancedKeyboard.ActionEventListener listener, int actionId)
Adds a listener to an action key event, registering to both press and release events.
boolean addActionEventListener(AdvancedKeyboard.ActionEventListener listener)
Adds a listener to all action key events.
boolean addActionEventListener(AdvancedKeyboard.ActionEventListener listener, int actionId, boolean pressed)
Adds a listener to a specific action key press or release.
boolean addLayoutChangeEventListener(AdvancedKeyboard.LayoutChangeEventListener listener)
Adds a listener to layout change events.
boolean addMultitapEventListener(AdvancedKeyboard.MultitapEventListener listener)
Adds a listener to multitap events.
AdvancedKeyboard.Configuration getConfiguration()
Gets the configuration related to some keyboard parameters.
int getCurrentLayoutIndex()
Gets the index of the current layout in which the keyboard is.
AdvancedKeyboard.Info getInfo()
Gets the info related to the installed keyboard configuration.
int getIntProperty(AdvancedKeyboard.Property property)
Reads an integer property.
List<AdvancedKeyboard.Overlay> getOverlays()
Gets the currently available keyboard overlays.
AdvancedKeyboard.Resources getResources()
Gets the resources related to the installed keyboard configuration.
String getStringProperty(AdvancedKeyboard.Property property)
Reads a string property.
boolean installKeyboard(String path, AdvancedKeyboard.PersistenceType persistenceType)
Command the installation of a new keyboard configuration, by specifying the path to the keyboard configuration file (as exported through the Keyboard Editor application), the desired type of persistence and the option to clear any existing configuration (outside of the default one).
boolean installOverlay(AdvancedKeyboard.Overlay overlay, AdvancedKeyboard.PersistenceType persistenceType)
Command the installation of a keyboard overlay, by specifying the overlay object for the keyboard to install.
boolean isLayoutLocked()
Checks if the keyboard layout is currently locked, preventing any layout change both manually and through the SDK.
boolean removeActionEventListener(AdvancedKeyboard.ActionEventListener listener, int actionId)
Removes a listener to a specific action key event, both for press and release.
boolean removeActionEventListener(AdvancedKeyboard.ActionEventListener listener, int actionId, boolean pressed)
Removes a listener to a specific action key press or release.
boolean removeActionEventListener(AdvancedKeyboard.ActionEventListener listener)
Removes a listener to all action key events.
boolean removeLayoutChangeEventListener(AdvancedKeyboard.LayoutChangeEventListener listener)
Removes a listener to layout change events.
boolean removeMultitapEventListener(AdvancedKeyboard.MultitapEventListener listener)
Removes a listener to multitap events.
void resetToDefault()
Resets the keyboard configuration to the default one.
boolean setConfiguration(AdvancedKeyboard.Configuration configuration)
Sets the keyboard configuration parameters.
boolean setCurrentLayoutIndex(int layoutIndex)
Sets the current layout index.
void setLayoutLocked(boolean layoutLocked)
Locks or unlocks the possibility for the keyboard to change its current layout both manually or through the SDK methods.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public boolean addActionEventListener (AdvancedKeyboard.ActionEventListener listener, int actionId)

Added in revision 22

Adds a listener to an action key event, registering to both press and release events.

Parameters
listener The listener to add.
actionId ID of the action event to listen to.
Returns
  • True if the listener has been added successfully, false otherwise or throws an exception if exceptions are enabled through the ErrorManager singleton.
Throws
DeviceException in case of error, when exceptions are enabled through the ErrorManager singleton.

public boolean addActionEventListener (AdvancedKeyboard.ActionEventListener listener)

Added in revision 22

Adds a listener to all action key events.

Parameters
listener The listener to add.
Returns
  • True if the listener has been added successfully, false otherwise or throws an exception if exceptions are enabled through the ErrorManager singleton.
Throws
DeviceException in case of error, when exceptions are enabled through the ErrorManager singleton.

public boolean addActionEventListener (AdvancedKeyboard.ActionEventListener listener, int actionId, boolean pressed)

Added in revision 22

Adds a listener to a specific action key press or release.

Parameters
listener The listener to add.
actionId ID of the action event to listen to.
pressed True to listen to the pressure event, false to listen to the release event.
Returns
  • True if the listener has been added successfully, false otherwise or throws an exception if exceptions are enabled through the ErrorManager singleton.
Throws
DeviceException in case of error, when exceptions are enabled through the ErrorManager singleton.

public boolean addLayoutChangeEventListener (AdvancedKeyboard.LayoutChangeEventListener listener)

Added in revision 22

Adds a listener to layout change events.

Parameters
listener The listener to add.
Returns
  • True if the listener has been added successfully, false otherwise or throws an exception if exceptions are enabled through the ErrorManager singleton.
Throws
DeviceException in case of error, when exceptions are enabled through the ErrorManager singleton.

public boolean addMultitapEventListener (AdvancedKeyboard.MultitapEventListener listener)

Added in revision 22

Adds a listener to multitap events.

Parameters
listener The listener to add.
Returns
  • True if the listener has been added successfully, false otherwise or throws an exception if exceptions are enabled through the ErrorManager singleton.
Throws
DeviceException in case of error, when exceptions are enabled through the ErrorManager singleton.

public AdvancedKeyboard.Configuration getConfiguration ()

Added in revision 22

Gets the configuration related to some keyboard parameters.

Returns
  • The keyboard configuration if available, otherwise it throws an exception if exceptions are enabled through the ErrorManager singleton or null if the exceptions are disabled.
Throws
DeviceException in case of error, when exceptions are enabled through the ErrorManager singleton.

public int getCurrentLayoutIndex ()

Added in revision 22

Gets the index of the current layout in which the keyboard is.

Returns
  • The layout index (0 is the default layout). If there is an error in reading this value, it will throw an exception if exceptions are enabled through the ErrorManager singleton or return Integer.MIN_VALUE if exceptions are disabled.
Throws
DeviceException in case of error, when exceptions are enabled through the ErrorManager singleton.

public AdvancedKeyboard.Info getInfo ()

Added in revision 22

Gets the info related to the installed keyboard configuration.

Returns
  • The keyboard configuration info if available, otherwise it throws an exception if exceptions are enabled through the ErrorManager singleton or null if the exceptions are disabled.
Throws
DeviceException in case of error, when exceptions are enabled through the ErrorManager singleton.

public int getIntProperty (AdvancedKeyboard.Property property)

Added in revision 22

Reads an integer property.

Parameters
property The property to read.
Returns
  • Value of the property if present, otherwise it throws an exception if exceptions are enabled through the ErrorManager singleton or it returns Integer.MIN_VALUE if exceptions are disabled.
Throws
DeviceException in case of error, when exceptions are enabled through the ErrorManager singleton.

public List<AdvancedKeyboard.Overlay> getOverlays ()

Added in revision 24

Gets the currently available keyboard overlays.

Returns
  • A list of available overlays that can be empty if there are no overlays available.

public AdvancedKeyboard.Resources getResources ()

Added in revision 22

Gets the resources related to the installed keyboard configuration.

Returns
  • The keyboard configuration resources if available, otherwise it throws an exception if exceptions are enabled through the ErrorManager singleton or null if the exceptions are disabled.
Throws
DeviceException in case of error, when exceptions are enabled through the ErrorManager singleton.

public String getStringProperty (AdvancedKeyboard.Property property)

Added in revision 22

Reads a string property.

Parameters
property The property to read.
Returns
  • Value of the property if present, otherwise it throws an exception if exceptions are enabled through the ErrorManager singleton or it returns null if exceptions are disabled.
Throws
DeviceException in case of error, when exceptions are enabled through the ErrorManager singleton.

public boolean installKeyboard (String path, AdvancedKeyboard.PersistenceType persistenceType)

Added in revision 22

Command the installation of a new keyboard configuration, by specifying the path to the keyboard configuration file (as exported through the Keyboard Editor application), the desired type of persistence and the option to clear any existing configuration (outside of the default one).

Parameters
path Path of a zip file created through the use of the Keyboard Editor application.
persistenceType Desired type of persistence. Be aware that the FACTORY_RESET_PERSISTENT is not allowed and will cause an installation failure.
Returns
  • true in case the installation is done and all new keyboard data is immediately available, false in case of installation failure or throws an exception if exceptions are enabled through the ErrorManager singleton.
Throws
DeviceException in case of error, when exceptions are enabled through the ErrorManager singleton.

public boolean installOverlay (AdvancedKeyboard.Overlay overlay, AdvancedKeyboard.PersistenceType persistenceType)

Added in revision 24

Command the installation of a keyboard overlay, by specifying the overlay object for the keyboard to install. This object must be one of the overlays available through the getOverlays() method.

Parameters
overlay The overlay object.
persistenceType Desired type of persistence. Be aware that the FACTORY_RESET_PERSISTENT is not allowed and will cause an installation failure.
Returns
  • true in case the installation is done and all new keyboard data is immediately available, false in case of installation failure or throws an exception if exceptions are enabled through the ErrorManager singleton.
Throws
DeviceException in case of error, when exceptions are enabled through the ErrorManager singleton.

public boolean isLayoutLocked ()

Added in revision 22

Checks if the keyboard layout is currently locked, preventing any layout change both manually and through the SDK.

Returns
  • True if the layout is locked, false otherwise. In case of error it will throw an exception if exceptions are enabled through the ErrorManager singleton or return false if exceptions are disabled.
Throws
DeviceException in case of error, when exceptions are enabled through the ErrorManager singleton.

public boolean removeActionEventListener (AdvancedKeyboard.ActionEventListener listener, int actionId)

Added in revision 22

Removes a listener to a specific action key event, both for press and release.

Parameters
listener The listener to remove.
actionId ID of the related action key.
Returns
  • True if the listener has been removed successfully, false otherwise or throws an exception if exceptions are enabled through the ErrorManager singleton.
Throws
DeviceException in case of error, when exceptions are enabled through the ErrorManager singleton.

public boolean removeActionEventListener (AdvancedKeyboard.ActionEventListener listener, int actionId, boolean pressed)

Added in revision 22

Removes a listener to a specific action key press or release.

Parameters
listener The listener to remove.
actionId ID of the related action key.
pressed True to remove the pressure event, false to remove the release event.
Returns
  • True if the listener has been removed successfully, false otherwise or throws an exception if exceptions are enabled through the ErrorManager singleton.
Throws
DeviceException in case of error, when exceptions are enabled through the ErrorManager singleton.

public boolean removeActionEventListener (AdvancedKeyboard.ActionEventListener listener)

Added in revision 22

Removes a listener to all action key events.

Parameters
listener The listener to remove.
Returns
  • True if the listener has been removed successfully, false otherwise or throws an exception if exceptions are enabled through the ErrorManager singleton.
Throws
DeviceException in case of error, when exceptions are enabled through the ErrorManager singleton.

public boolean removeLayoutChangeEventListener (AdvancedKeyboard.LayoutChangeEventListener listener)

Added in revision 22

Removes a listener to layout change events.

Parameters
listener The listener to remove.
Returns
  • True if the listener has been removed successfully, false otherwise or throws an exception if exceptions are enabled through the ErrorManager singleton.
Throws
DeviceException in case of error, when exceptions are enabled through the ErrorManager singleton.

public boolean removeMultitapEventListener (AdvancedKeyboard.MultitapEventListener listener)

Added in revision 22

Removes a listener to multitap events.

Parameters
listener The listener to remove.
Returns
  • True if the listener has been removed successfully, false otherwise or throws an exception if exceptions are enabled through the ErrorManager singleton.
Throws
DeviceException in case of error, when exceptions are enabled through the ErrorManager singleton.

public void resetToDefault ()

Added in revision 24

Resets the keyboard configuration to the default one.

public boolean setConfiguration (AdvancedKeyboard.Configuration configuration)

Added in revision 22

Sets the keyboard configuration parameters.

Parameters
configuration The keyboard configuration to set.
Returns
  • True in case the configuration has been set correctrly, otherwise it throws an exception if exceptions are enabled through the ErrorManager singleton or returns false if the exceptions are disabled.
Throws
DeviceException in case of error, when exceptions are enabled through the ErrorManager singleton.

public boolean setCurrentLayoutIndex (int layoutIndex)

Added in revision 22

Sets the current layout index. This operation will be done in a moment in which all keyboard keys are released.

Parameters
layoutIndex The layout index.
Returns
  • True in case the layout has been set successfully. If there is an error in reading this value, it will throw an exception if exceptions are enabled through the ErrorManager singleton or return false if exceptions are disabled.
Throws
DeviceException in case of error, when exceptions are enabled through the ErrorManager singleton.

public void setLayoutLocked (boolean layoutLocked)

Added in revision 22

Locks or unlocks the possibility for the keyboard to change its current layout both manually or through the SDK methods.

Parameters
layoutLocked True to lock the layout, false to unlock it.
Throws
DeviceException in case of error, when exceptions are enabled through the ErrorManager singleton.