@@ -0,0 +1,1301 @@
+package vm;%0A%0Aimport java.awt.event.KeyAdapter;%0Aimport java.awt.event.KeyEvent;%0A%0Apublic class Keyboard extends KeyAdapter %7B%0A    private static final int%5B%5D KEY_MAP= %7B%0A            KeyEvent.VK_4, // 1%0A            KeyEvent.VK_5, // 2%0A            KeyEvent.VK_6, // 3%0A            KeyEvent.VK_7, // 4%0A            KeyEvent.VK_R, // 5%0A            KeyEvent.VK_Y, // 6%0A            KeyEvent.VK_U, // 7%0A            KeyEvent.VK_F, // 8%0A            KeyEvent.VK_G, // 9%0A            KeyEvent.VK_H, // A%0A            KeyEvent.VK_J, // B%0A            KeyEvent.VK_V, // C%0A            KeyEvent.VK_B, // D%0A            KeyEvent.VK_N, // E%0A            KeyEvent.VK_M, // F%0A    %7D;%0A%0A    private int currentKeyPerssed;%0A%0A%0A    public Keyboard() %7B%0A        currentKeyPerssed = 0;%0A    %7D%0A%0A    @Override%0A    public void keyPressed(KeyEvent keyEvent) %7B%0A        currentKeyPerssed = mapKeycodeToChip8Key(keyEvent.getKeyCode());%0A    %7D%0A%0A    @Override%0A    public void keyReleased(KeyEvent keyEvent) %7B%0A        currentKeyPerssed = 0;%0A    %7D%0A%0A    public int getCurrentKeyPerssed() %7B%0A        return currentKeyPerssed;%0A    %7D%0A%0A    private int mapKeycodeToChip8Key(int keycode) %7B%0A        for (int i = 0; i %3C KEY_MAP.length; i++) %7B%0A            if (KEY_MAP%5Bi%5D == keycode) %7B%0A                return i + 1;%0A            %7D%0A        %7D%0A%0A        return 0;%0A    %7D%0A%7D%0A

Add Keyboard class