diff --git a/src/keyboard_control.cpp b/src/keyboard_control.cpp index 0b6ca2698..e429783f4 100644 --- a/src/keyboard_control.cpp +++ b/src/keyboard_control.cpp @@ -344,6 +344,8 @@ static string get_keycode_representation(int64_t ch) { case K_DOWN: return "K_DOWN"; case K_LEFT: return "K_LEFT"; case K_RIGHT: return "K_RIGHT"; + case K_PGUP: return "K_PGUP"; + case K_PGDOWN: return "K_PGDOWN"; } if (ch >= 1 && ch <= 'z' - 'a' + 1) { diff --git a/src/keyboard_control.h b/src/keyboard_control.h index 0006bb646..8d8664ff2 100644 --- a/src/keyboard_control.h +++ b/src/keyboard_control.h @@ -105,10 +105,12 @@ private: #endif // __cplusplus // values are byte represenations of escape sequences (without ESC itself) -#define K_UP 0x1b5b41 -#define K_DOWN 0x1b5b42 -#define K_RIGHT 0x1b5b43 -#define K_LEFT 0x1b5b44 +#define K_UP 0x1b5b41 +#define K_DOWN 0x1b5b42 +#define K_RIGHT 0x1b5b43 +#define K_LEFT 0x1b5b44 +#define K_PGUP 0x1b5b357e +#define K_PGDOWN 0x1b5b367e #define K_CTRL(x) (1 + ((x) >= 'A' && (x) <= 'Z' ? (x) - 'A' + 'a' : (x)) - 'a') #define K_CTRL_UP 0x1b5b313b3541LL #define K_CTRL_DOWN 0x1b5b313b3542LL diff --git a/src/video_display/gl.cpp b/src/video_display/gl.cpp index 7d8a9c332..0e18a3181 100644 --- a/src/video_display/gl.cpp +++ b/src/video_display/gl.cpp @@ -1014,6 +1014,8 @@ static int64_t translate_glut_to_ug(int key, bool is_special) { case GLUT_KEY_UP: return K_UP; case GLUT_KEY_RIGHT: return K_RIGHT; case GLUT_KEY_DOWN: return K_DOWN; + case GLUT_KEY_PAGE_UP: return K_PGUP; + case GLUT_KEY_PAGE_DOWN: return K_PGDOWN; } } else { if (glutGetModifiers() == 0) { diff --git a/src/video_display/sdl2.cpp b/src/video_display/sdl2.cpp index a4aed603f..253f57323 100644 --- a/src/video_display/sdl2.cpp +++ b/src/video_display/sdl2.cpp @@ -226,6 +226,8 @@ static int64_t translate_sdl_key_to_ug(SDL_Keysym sym) { case SDLK_LEFT: return K_LEFT; case SDLK_DOWN: return K_DOWN; case SDLK_UP: return K_UP; + case SDLK_PAGEDOWN: return K_PGDOWN; + case SDLK_PAGEUP: return K_PGUP; } return -1; }