// Path: core/src/main/java/net/panuska/tlappy/Device.java
// public static Keyboard keyboard;


import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.SurfaceView;
import android.view.View;
import net.panuska.tlappy.mobile.R;
import static net.panuska.tlappy.Device.keyboard;

    @Override
    public void onWindowFocusChanged(boolean hasFocus) {
        super.onWindowFocusChanged(hasFocus);
        if (hasFocus) {                         // when getting back from pause
            Device.vram.refresh();
        }
    }

    private static final int MOVE_LIMIT = 5;

    private float initialX;
    private float initialY;
    private float lastX;
    private float lastY;
    boolean isMove;

    static final int SPACE_BAR = 32;
    static final int LEFT = 37;
    static final int UP = 38;
    static final int RIGHT = 39;
    static final int DOWN = 40;

    private int key;

    @Override
    public boolean dispatchKeyEvent(KeyEvent event) {
        int translatedKey = CustomControlsActivity.keyboardMap.get(event.getKeyCode(), -1);
        if (translatedKey != -1) { // value found
            if (event.getAction() == KeyEvent.ACTION_DOWN) {
// Path: core/src/main/java/net/panuska/tlappy/Device.java
// public static Keyboard keyboard;


// Path: mobile/src/main/java/net/panuska/tlappy/FullscreenActivity.java
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.SurfaceView;
import android.view.View;
import net.panuska.tlappy.mobile.R;
import static net.panuska.tlappy.Device.keyboard;


    @Override
    public void onWindowFocusChanged(boolean hasFocus) {
        super.onWindowFocusChanged(hasFocus);
        if (hasFocus) {                         // when getting back from pause
            Device.vram.refresh();
        }
    }

    private static final int MOVE_LIMIT = 5;

    private float initialX;
    private float initialY;
    private float lastX;
    private float lastY;
    boolean isMove;

    static final int SPACE_BAR = 32;
    static final int LEFT = 37;
    static final int UP = 38;
    static final int RIGHT = 39;
    static final int DOWN = 40;

    private int key;

    @Override
    public boolean dispatchKeyEvent(KeyEvent event) {
        int translatedKey = CustomControlsActivity.keyboardMap.get(event.getKeyCode(), -1);
        if (translatedKey != -1) { // value found
            if (event.getAction() == KeyEvent.ACTION_DOWN) {
                keyboard.keyDown(translatedKey);