From 523cc794dfef74f5e5f50fe6fe55a86c9b2d31bb Mon Sep 17 00:00:00 2001 From: curt Date: Mon, 4 Jun 2001 21:07:39 +0000 Subject: [PATCH] - implemented GLUTkeyup and GLUTspecialkeyup --- src/Main/keyboard.cxx | 39 +++++++++++++++++++++++++++++++++------ 1 file changed, 33 insertions(+), 6 deletions(-) diff --git a/src/Main/keyboard.cxx b/src/Main/keyboard.cxx index 706ba2aae..cb9c79ccb 100644 --- a/src/Main/keyboard.cxx +++ b/src/Main/keyboard.cxx @@ -37,6 +37,8 @@ #include +#include "keyboard.hxx" + /** * Construct the modifiers. @@ -58,7 +60,7 @@ static inline int get_mods () /** - * Keyboard event handler for Glut. + * Key-down event handler for Glut. * *

Pass the value on to the FGInput module unless PUI wants it.

* @@ -70,16 +72,27 @@ void GLUTkey(unsigned char k, int x, int y) { // Give PUI a chance to grab it first. if (!puKeyboard(k, PU_DOWN)) - // This is problematic; it allows - // (say) P and [SHIFT]P to be - // distinguished, but is that a good - // idea? current_input.doKey(k, get_mods(), x, y); } /** - * Special key handler for Glut. + * Key-up event handler for GLUT. + * + *

PUI doesn't use this, so always pass it to the input manager.

+ * + * @param k The integer value for the key pressed. + * @param x (unused) + * @param y (unused) + */ +void GLUTkeyup(unsigned char k, int x, int y) +{ + current_input.doKey(k, get_mods()|FGInput::FG_MOD_UP, x, y); +} + + +/** + * Special key-down handler for Glut. * *

Pass the value on to the FGInput module unless PUI wants it. * The key value will have 256 added to it.

@@ -97,4 +110,18 @@ void GLUTspecialkey(int k, int x, int y) } +/** + * Special key-up handler for Glut. + * + * @param k The integer value for the key pressed (will have 256 added + * to it). + * @param x (unused) + * @param y (unused) + */ +void GLUTspecialkeyup(int k, int x, int y) +{ + current_input.doKey(k + 256, get_mods()|FGInput::FG_MOD_UP, x, y); +} + + // end of keyboard.cxx -- 2.39.5