================
11-15 13:13:21.859: INFO/WindowManager(201): [e] [interceptKeyTq] event.scancode139
11-15 13:13:21.859: DEBUG/WindowManager(201): keyEvent event=KeyEvent{action=0 code=82 repeat=0 meta=0 scancode=0 chars=null mFlags=0}
11-15 13:13:21.867: INFO/InputMethodService(293): [T] Scancode = 139, Keycode = 82
11-15 13:13:21.882: INFO/WindowManager(201): [e] [interceptKeyTq] event.scancode139
11-15 13:13:21.882: DEBUG/WindowManager(201): keyEvent event=KeyEvent{action=1 code=82 repeat=0 meta=0 scancode=0 chars=null mFlags=0}
=================
아래와 같이 onKeyDown() 메서드를 이용해 키 클릭에 대한 이벤트를 잡아 올 수 있다.
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if(keyCode == 82){
/* 이부분에 구현할 Action 을 넣는다. */
Intent intent = new Intent(this, DiscoverSearchActivity.class);
intent.putExtra("cpName", app_id);
intent.putExtra("package_nm", package_nm);
Util.startActivity(this, intent);
/* Action */
}
return super.onKeyDown(keyCode, event);
}
댓글 없음:
댓글 쓰기