mirror of
https://github.com/chararomandroid/android_device_samsung_a20
synced 2026-08-23 04:25:33 -04:00
universal7885: Import KeyLogger
This lib helps to log input keycodes
This commit is contained in:
parent
8b275247f9
commit
8582551795
4 changed files with 54 additions and 0 deletions
6
universal7885-common/keyhandler/Android.bp
Normal file
6
universal7885-common/keyhandler/Android.bp
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
java_library {
|
||||
name: "keyhandler",
|
||||
srcs: [
|
||||
"src/com/eurekateam/keyhandler/KeyHandler.java",
|
||||
],
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* Copyright (C) 2021 The LineageOS Project
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package com.eurekateam.keyhandler;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
|
||||
import com.android.internal.os.DeviceKeyHandler;
|
||||
|
||||
public class KeyHandler implements DeviceKeyHandler {
|
||||
private static final String TAG = "KeyHandler";
|
||||
// private static final KEYCODE_SIDE_FP = -1;
|
||||
public KeyHandler(Context context) {
|
||||
Log.i(TAG, "KeyHandler constructor called");
|
||||
}
|
||||
|
||||
public KeyEvent handleKeyEvent(KeyEvent event) {
|
||||
int scanCode = event.getScanCode();
|
||||
Log.i(TAG, "handleKeyEvent=" + scanCode);
|
||||
/*
|
||||
switch (scanCode) {
|
||||
case KEYCODE_SIDE_FP:
|
||||
return null;
|
||||
default:
|
||||
return event;
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue