Htc ime mod has a very useful feature for android phones without d-pad and track ball, use volume keys to move cursor.
But unfortunately I can't take benefit of it because htc ime does not support my native language.
After looking around android source code, I figured out how to implement that myself.
With this framework.jar, when soft keyboard is shown, volume up/down will generate d-pad left/right key events, so you can move cursor in any input box, even when selecting text. It should work with any ime, and should not conflict if ime handle volume keys itself.
The framework.jar is modified for 1.100.39.EMEA.GEN1_A21E_A rom, I have no idea whether it will work with other roms(I guess not).
Unpack the zip, use the following command to flash:
Here is the patch against android's base framework android-2.1_r2.1p2 branch http://android.git.k...5111dda41187332
The patch and modified deassemble code(smali) are also provided in the zip pack.
framework_mod.zip 2.76MB
110 downloads
Update:
add mod for Froyo/E FRF91 framework-mod-froyo.zip
But unfortunately I can't take benefit of it because htc ime does not support my native language.
After looking around android source code, I figured out how to implement that myself.
With this framework.jar, when soft keyboard is shown, volume up/down will generate d-pad left/right key events, so you can move cursor in any input box, even when selecting text. It should work with any ime, and should not conflict if ime handle volume keys itself.
The framework.jar is modified for 1.100.39.EMEA.GEN1_A21E_A rom, I have no idea whether it will work with other roms(I guess not).
Unpack the zip, use the following command to flash:
adb remount adb pull /system/framework/framework.jar framework.jar adb push framework-mod.jar /system/framework/framework.jar adb reboot
Here is the patch against android's base framework android-2.1_r2.1p2 branch http://android.git.k...5111dda41187332
diff --git a/core/java/android/inputmethodservice/InputMethodService.java b/core/java/android/inputmethodservice/InputMethodService.java
index 5499bba..315cc01 100644
--- a/core/java/android/inputmethodservice/InputMethodService.java
+++ b/core/java/android/inputmethodservice/InputMethodService.java
@@ -1600,6 +1600,20 @@ public class InputMethodService extends AbstractInputMethodService {
}
return false;
}
+
+ if (keyCode == KeyEvent.KEYCODE_VOLUME_UP) {
+ if(isInputViewShown()) {
+ sendDownUpKeyEvents(KeyEvent.KEYCODE_DPAD_LEFT);
+ return true;
+ }
+ }
+ if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN) {
+ if(isInputViewShown()) {
+ sendDownUpKeyEvents(KeyEvent.KEYCODE_DPAD_RIGHT);
+ return true;
+ }
+ }
+
return doMovementKey(keyCode, event, MOVEMENT_DOWN);
}
@@ -1645,6 +1659,12 @@ public class InputMethodService extends AbstractInputMethodService {
&& !event.isCanceled()) {
return handleBack(true);
}
+
+ if (keyCode == KeyEvent.KEYCODE_VOLUME_UP || keyCode == KeyEvent.KEYCODE_VOLUME_DOWN) {
+ if(isInputViewShown()) {
+ return true;
+ }
+ }
return doMovementKey(keyCode, event, MOVEMENT_UP);
}
The patch and modified deassemble code(smali) are also provided in the zip pack.
framework_mod.zip 2.76MB
110 downloadsUpdate:
add mod for Froyo/E FRF91 framework-mod-froyo.zip
Edited by azuwis, 27 July 2010 - 09:07 AM.







Sign In
Create Account

Back to top










