MC33 API to get Current State of BLUE - ORANGE - SHIFT keys

Article ID: 65879746

Issue / Question

Query key state of Blue - Orange - Shift Key

Applicable To

MC33 MC93

Resolution / Answer

Query key state of Blue - Orange - Shift Key

Customer can simulate a keypress to capture the keystate if using a Full Screen application using an OnCreate


1. The key code for orange and blue and shift is below(as per MC33 ) 

public static final int KEYCODE_SYMBOL_BLUE = 10027; 

public static final int KEYCODE_SYMBOL_ORANGE = 10028; 

public static final int KEYCODE_SYMBOL_SHIFT = 10032;

2. Customer can override Android API onKeyDown to access orange key or Blue key press in their application. Below is the code snippet example :- 

@Override 

public boolean onKeyDown(int keyCode, KeyEvent event) { 

Log.d(TAG, "onKeyDown: Keycode: "+keyCode+" KeyEvent: "+event); 

if(KEYCODE_SYMBOL_ORANGE == keyCode){ 

Toast.makeText(this, "KeyName:KEYCODE_SYMBOL_ORANGE pressed!!!", Toast.LENGTH_SHORT).show(); 

}else if(KEYCODE_SYMBOL_BLUE == keyCode){ 

Toast.makeText(this, "KeyName:KEYCODE_SYMBOL_BLUE pressed!!!", Toast.LENGTH_SHORT).show(); 

} 

return super.onKeyDown(keyCode, event); 

}

+ Applicable Products

  • MC3300
  • MC9300 Mobile Computer