mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-06 03:50:19 +02:00
git-svn-id: https://only.mawhrin.net/repos/FBReaderJ/trunk@302 6a642e6f-84f6-412e-ac94-c4a38d5a04b0
This commit is contained in:
parent
ef76da8f9a
commit
a2d25ac2c2
2 changed files with 11 additions and 2 deletions
|
@ -197,10 +197,12 @@ public abstract class ZLApplication {
|
||||||
action.checkAndRun();
|
action.checkAndRun();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//may be protected
|
||||||
abstract protected ZLKeyBindings keyBindings();
|
abstract public ZLKeyBindings keyBindings();
|
||||||
|
|
||||||
public final void doActionByKey(String key) {
|
public final void doActionByKey(String key) {
|
||||||
|
|
||||||
|
System.out.println("key in application->"+ key);
|
||||||
ZLAction a = getAction(keyBindings().getBinding(key));
|
ZLAction a = getAction(keyBindings().getBinding(key));
|
||||||
if ((a != null) &&
|
if ((a != null) &&
|
||||||
(!a.useKeyDelay() /*||
|
(!a.useKeyDelay() /*||
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
package org.zlibrary.core.application;
|
package org.zlibrary.core.application;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
import org.zlibrary.core.options.ZLIntegerOption;
|
import org.zlibrary.core.options.ZLIntegerOption;
|
||||||
import org.zlibrary.core.options.ZLIntegerRangeOption;
|
import org.zlibrary.core.options.ZLIntegerRangeOption;
|
||||||
|
@ -26,6 +28,7 @@ public class ZLKeyBindings {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void bindKey(String key, int code) {
|
public void bindKey(String key, int code) {
|
||||||
|
//System.out.println("key-->"+key);
|
||||||
myBindingsMap.put(key, code);
|
myBindingsMap.put(key, code);
|
||||||
myIsChanged = true;
|
myIsChanged = true;
|
||||||
}
|
}
|
||||||
|
@ -34,6 +37,10 @@ public class ZLKeyBindings {
|
||||||
return myBindingsMap.get(key);
|
return myBindingsMap.get(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Set<Map.Entry<String, Integer>> getKeys() {
|
||||||
|
return Collections.unmodifiableSet(myBindingsMap.entrySet());
|
||||||
|
}
|
||||||
|
|
||||||
private void loadDefaultBindings() {
|
private void loadDefaultBindings() {
|
||||||
Map<String,Integer> keymap = new HashMap<String,Integer>();
|
Map<String,Integer> keymap = new HashMap<String,Integer>();
|
||||||
new ZLKeyBindingsReader(keymap).readBindings();
|
new ZLKeyBindingsReader(keymap).readBindings();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue