INNER CODE UNIT · Java
setMouseBinding
GiveJavaAChance/PolyrayGameEngine · src/polyray/BindSet.java:47
public final void setMouseBinding(int button, MousePress r) {
this.mouseBindings.put(button, r);
}
public final void setKeyBinding(int key, Runnable r) {
this.keyBindings.put(key, r);
}
public final void mousePress(float x, float y, int button) {
MousePress r = this.mouseBindings.get(button);
if (r == null) {
if (parent != null) {
parent.mousePress(x, y, button);
}
return;
}
r.run(x, y);
}