Open bardo84 opened 12 years ago
The PRS-T1 page turn arrows are, to the Android system, buttons 105 and 106 and are mapped as DPAD_LEFT and DPAD_RIGHT. So the following code: (thnx NdrU!!) should be adapted accordingly.
@Override
public boolean dispatchKeyEvent(KeyEvent event) {
int action = event.getAction();
int keyCode = event.getKeyCode();
WebView scrollView = (WebView) findViewById(R.id.ch01);
switch (keyCode) {
case KeyEvent.KEYCODE_VOLUME_UP:
if (action == KeyEvent.ACTION_DOWN) {
scrollView.pageUp(false);
}
return true;
case KeyEvent.KEYCODE_VOLUME_DOWN:
if (action == KeyEvent.ACTION_DOWN) {
scrollView.pageDown(false);
}
return true;
default:
return super.dispatchKeyEvent(event);
}
}
Page Turn Buttons on Rooted PRS-T1 .. The page turn arrows are, to the Android system, buttons 105 and 106 and are mapped as DPAD_LEFT and DPAD_RIGHT. The Sony apps are written in such a way that these "keyboard" commands have meaning. Most other apps don't give them a roll or at least a useful one, though someone has been kind enough to tweak FBReader to use them (see the Rooting and Modding Wiki). .. Source: http://www.mobileread.com/forums/showthread.php?t=163458