package com.arinerron.forux.core;

import javax.swing.KeyStroke;
import java.util.ArrayList;
import java.util.List;

public class KeyManager {
    private Game game = null;
    private List<Integer> chars = new ArrayList<>();
    private List<Integer> buttons = new ArrayList<>();

    protected KeyManager(Game game) {
        this.game = game;
    }

    public List<Character> getPressedKeys() {
        List<Character> chars2 = new ArrayList<>();
        for(int c : chars)
            chars2.add(new Character((char)c));

        return chars2;
    }

    public List<Integer> getPressedMouseButtons() {
        return this.buttons;
    }

    public boolean isKeyPressed(char c) {
        return this.chars.contains(KeyStroke.getKeyStroke(c));
    }

    public boolean isKeyPressed(int c) {
        return this.chars.contains(c);
    }

    public boolean isMouseButtonPressed(int button) {
        return this.buttons.contains(button);
    }

    protected void onKeyPress(int c) {
        this.chars.add(c);
    }

    protected void onKeyRelease(int c) {
        this.chars.remove(c);
    }

    protected void onMousePress(int b) {
        this.buttons.add(b);
    }

    protected void onMouseRelease(int b) {
        this.buttons.remove(b);
    }

    public Game getGame() {
        return this.game;
    }
}

@@ -1084,17 +1084,34 @@
 .remove(
-c
+Integer.valueOf(c)
 );%0A    %7D
@@ -1260,17 +1260,34 @@
 .remove(
-b
+Integer.valueOf(b)
 );%0A    %7D

fix protected function