diff --git a/README.md b/README.md index 55d055d..99467c4 100644 --- a/README.md +++ b/README.md @@ -28,12 +28,11 @@ Boomer is written in Nim for Linux. Zoomer is ported to C and uses Win32 API. | Key | Action | |-----|--------| -| `Escape` | Quit app | -| `Q` | Quit app | +| `Escape` / `Q` | Quit | | `0` | Reset zoom | -| `Mouse button` | Pan | -| `+` | Zoom in | -| `-` | Zoom out | | `Scroll wheel` | Zoom +/- | +| `+` / `-` | Zoom in/out | +| `Mouse button` | Pan | +| `WASD` / `Arrows` | Move around | | `F` | Toggle flashlight | | `Ctrl` + `Scroll wheel` | Change size of flashlight | diff --git a/src/zoomer_main.c b/src/zoomer_main.c index ce816f7..8c4cbba 100644 --- a/src/zoomer_main.c +++ b/src/zoomer_main.c @@ -6,6 +6,7 @@ #define INITIAL_FL_DELTA_RADIUS 250.0f #define FL_DELTA_RADIUS_DECELERATION 10.0f +#define PAN_SPEED 20.0f typedef struct { @@ -203,6 +204,22 @@ void key_callback(GLFWwindow* window, int key, int scancode, int action, int mod camera.position = (Vector){ 0.0f, 0.0f }; camera.velocity = (Vector){ 0.0f, 0.0f }; break; + case GLFW_KEY_W: + case GLFW_KEY_UP: + camera.position.y -= PAN_SPEED; + break; + case GLFW_KEY_S: + case GLFW_KEY_DOWN: + camera.position.y += PAN_SPEED; + break; + case GLFW_KEY_A: + case GLFW_KEY_LEFT: + camera.position.x -= PAN_SPEED; + break; + case GLFW_KEY_D: + case GLFW_KEY_RIGHT: + camera.position.x += PAN_SPEED; + break; case GLFW_KEY_F: flashlight.is_enabled = !flashlight.is_enabled; break;