GoldenDict is a great program and I use it quite extensively on my Sony e-book reader.
It can be made even better by making it more friendly for e-ink display devices by doing the following:
1. Reduce screen refresh: GoldenDict currently does a animated scrolling when jumping between dictionaries. This looks nice on regular LCD screens but introduces some slow screen refresh on e-ink devices. It would be great if there can be an option to turn it off by jumping to the next dictionary directly. This can be done quite easily by passing a parameter to gdNextArticle() and gdPreviousArticle() so that if it is set to true, jump directly instead of doing the incremental animated scrolling.
2. Making use of the next page/previous page keys on the Sony and Nook e-book reader to allow full page scrolling. Once again, this is to reduce slow screen flicker. Here is the code to do it (lifted off the aardict-android project):
public static final int NOOK_KEY_PREV_LEFT = 92;
public static final int NOOK_KEY_NEXT_LEFT = 93;
public static final int NOOK_KEY_PREV_RIGHT = 94;
public static final int NOOK_KEY_NEXT_RIGHT = 95;
// [TST] Mon Feb 27 00:23:07 2012
// d:/ebook/sony_backup/EbookReader/smali/com/sony/drbd/ebook/reader/Constants.smali
protected static final int SONY_SCANCODE_PREVKEY = 105; // 0x69
protected static final int SONY_SCANCODE_NEXTKEY = 106; // 0x70
.....
@Override
public boolean dispatchKeyEvent(KeyEvent event) {
if (event.getAction() != KeyEvent.ACTION_DOWN) {
// Use Key down rather than up so that we can hold it
// down to repeat
return super.dispatchKeyEvent(event);
}
int keyCode = event.getKeyCode();
Log.w(TAG, "dispatchKeyEvent("+ keyCode +", "+ event.getScanCode()+")");
if (keyCode == 0) {
int scanCode = event.getScanCode();
if (scanCode == SONY_SCANCODE_PREVKEY) {
keyCode = NOOK_KEY_PREV_LEFT:
}
else if (event.getScanCode() == SONY_SCANCODE_NEXTKEY) {
keyCode = NOOK_KEY_NEXT_LEFT:
}
}
switch (keyCode) {
// D:\android\docs\reference\android\view\KeyEvent.html
case KeyEvent.KEYCODE_BACK:
goBack();
break;
case NOOK_KEY_PREV_LEFT:
case NOOK_KEY_PREV_RIGHT:
case KeyEvent.KEYCODE_VOLUME_UP:
articleView.pageUp(false);
break;
case KeyEvent.KEYCODE_VOLUME_DOWN:
case NOOK_KEY_NEXT_LEFT:
case NOOK_KEY_NEXT_RIGHT:
articleView.pageDown(false);
break;
default:
return super.dispatchKeyEvent(event);
}
return true;
}
Thank you for your consideration,
ST