Android : KeyCode KeyEvent.Space not working

on Saturday, November 1, 2014


I was making my own keyboard and I want to a specific method if a user presses SPACE key, but I can't seem to log the activity that space key is pressed


This is the code



@Override public boolean onKeyDown(int keyCode, KeyEvent event) {
switch (keyCode) {
//Default built in codes up here
case KeyEvent.KEYCODE_SPACE:
Log.v("Space", "Pressed");
break;
//Other codes
}
}


And this is the log when I press Space Key



11-02 01:07:53.152 30920-30920/co.nexlabs.NexyKeyboard I/View﹕ Touch down dispatch to com.co.nexlabs.nexyKeyboard.LatinKeyboardView{422131b0 V.ED.... ......I. 0,0-540,300 #7f080001 app:id/keyboard}, event = MotionEvent { action=ACTION_DOWN, id[0]=0, x[0]=285.0, y[0]=255.0, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=111023292, downTime=111023292, deviceId=2, source=0x1002 }
11-02 01:07:53.170 30920-30920/co.nexlabs.NexyKeyboard I/SurfaceTextureClient﹕ [STC::queueBuffer] (this:0x5a7d0f40) fps:1.58, dur:1267.79, max:1165.25, min:102.54
11-02 01:07:53.203 30920-30920/co.nexlabs.NexyKeyboard D/GraphicBuffer﹕ create handle(0x5d3c9358) (w:176, h:120, f:1)
11-02 01:07:55.148 30920-30920/co.nexlabs.NexyKeyboard I/View﹕ Touch up dispatch to com.co.nexlabs.nexyKeyboard.LatinKeyboardView{422131b0 V.ED.... ......I. 0,0-540,300 #7f080001 app:id/keyboard}, event = MotionEvent { action=ACTION_UP, id[0]=0, x[0]=282.5, y[0]=254.0, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=111025289, downTime=111023292, deviceId=2, source=0x1002 }
11-02 01:07:55.158 30920-30920/co.nexlabs.NexyKeyboard I/SurfaceTextureClient﹕ [STC::queueBuffer] (this:0x5a7d0f40) fps:0.50, dur:1988.15, max:1988.15, min:1988.15
11-02 01:07:55.229 30920-30920/co.nexlabs.NexyKeyboard D/GraphicBuffer﹕ close handle(0x5d3c9358) (w:176 h:120 f:1)

0 comments:

Post a Comment