INNER CODE UNIT · Java

setKeyBinding

GiveJavaAChance/PolyrayGameEngine · src/polyray/BindSet.java:51

    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);
    }

    public final void keyPress(int key) {
        Runnable r = this.keyBindings.get(key);
        if (r == null) {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…