summaryrefslogtreecommitdiff
path: root/setup
diff options
context:
space:
mode:
authorSimon Howard2007-07-29 23:41:12 +0000
committerSimon Howard2007-07-29 23:41:12 +0000
commite4681dd485de5a393070e3fcb91505116405cc1d (patch)
tree63443c3d1671a6e3febfac62c20092917c32d034 /setup
parentb361695b7aa13dc89149e7394e273b204394ef79 (diff)
downloadchocolate-doom-e4681dd485de5a393070e3fcb91505116405cc1d.tar.gz
chocolate-doom-e4681dd485de5a393070e3fcb91505116405cc1d.tar.bz2
chocolate-doom-e4681dd485de5a393070e3fcb91505116405cc1d.zip
Allow more than the standard three mouse buttons to be defined through
setup (hopefully) Subversion-branch: /trunk/chocolate-doom Subversion-revision: 939
Diffstat (limited to 'setup')
-rw-r--r--setup/txt_mouseinput.c17
1 files changed, 1 insertions, 16 deletions
diff --git a/setup/txt_mouseinput.c b/setup/txt_mouseinput.c
index 6b70d110..05c89b39 100644
--- a/setup/txt_mouseinput.c
+++ b/setup/txt_mouseinput.c
@@ -33,21 +33,6 @@
#define MOUSE_INPUT_WIDTH 8
-static int MouseButtonToSetting(int b)
-{
- switch (b)
- {
- case TXT_MOUSE_LEFT:
- return 0;
- case TXT_MOUSE_RIGHT:
- return 1;
- case TXT_MOUSE_MIDDLE:
- return 2;
- default:
- return -1;
- }
-}
-
static int MousePressCallback(txt_window_t *window,
int x, int y, int b,
TXT_UNCAST_ARG(mouse_input))
@@ -56,7 +41,7 @@ static int MousePressCallback(txt_window_t *window,
// Got the mouse press. Save to the variable and close the window.
- *mouse_input->variable = MouseButtonToSetting(b);
+ *mouse_input->variable = b - TXT_MOUSE_BASE;
TXT_EmitSignal(mouse_input, "set");
TXT_CloseWindow(window);