KeyboardManagerMapKeyCode Method |
Assigns a virtual key code to a physical key.
Namespace:
Com.Datalogic.Decode
Assembly:
datalogic-xamarin-sdk (in datalogic-xamarin-sdk.dll) Version: 1.0.0.0
(1.0.0.0)
Syntax
public virtual int MapKeyCode (Com.Datalogic.Device.Input.VScanEntry scanCode, Com.Datalogic.Device.Input.KeyCodeEntry keyCode);
Public Virtual Integer MapKeyCode (Com.Datalogic.Device.Input.VScanEntry scanCode, Com.Datalogic.Device.Input.KeyCodeEntry keyCode);
Parameters
- scanCode
- Type: Com.Datalogic.Device.Input.VScanEntry
a VScanEntry representing the virtual scan code. - keyCode
- Type: Com.Datalogic.Device.Input.KeyCodeEntry
a KeyCodeEntry representing the Android key code and meta state. Example code to avoid any keyboard event on the left scan
trigger pressure: (new KeyboardManager()).mapKeyCode(new VScanEntry(VScanCode.VSCAN_LEFT_TRIGGER), new KeyCodeEntry(KeyEvent.KEYCODE_UNKNOWN)); Example code to map the left scan trigger to the Android left
trigger button key code: (new KeyboardManager()).mapKeyCode(new VScanEntry(VScanCode.VSCAN_LEFT_TRIGGER), new KeyCodeEntry(KeyEvent.KEYCODE_BUTTON_L1)); Example code to map the enter key to the Android home key
code: (new KeyboardManager()).mapKeyCode(new VScanEntry(VScanCode.VSCAN_RIGHT_ENTER), new KeyCodeEntry(KeyEvent.KEYCODE_HOME));
Return Value
Type: System.Int32
int DeviceException.SUCCESS in case of success,
otherwise a possible error code, matching one of the DeviceException error constants.
Exceptions
Exception |
Condition |
DeviceException |
in case of error, when exceptions are enabled through the ErrorManager singleton. |
Remarks
Assigns a virtual key code to a physical key. If a mapping for the
desired physical key is already assigned and saved, it will be
overridden.
[Android Documentation]
See Also