public void key(KeyEvent e, int s) {
        int Key = e.getKeyCode();
        if (s == KEY_PRESS) {
            boolean rep = false;
            for (int i=0; i <= keys.size()-1; i++) {
                if (keys.get(i) == Key) {
                    rep = true;
                }
            }
            if (keys.size() < max_keys && !rep) {
                keys.add(Key);
            }
        } else if (s == KEY_RELEASE) {
            for (int i=0; i <= keys.size()-1; i++) {
                if (keys.get(i) == Key) {
                    keys.remove(i);
                }
            }
        } 
    }