Fixing issue when assigning mouse button if a citem is still pointed out; Fixing still processing key commands even if we want to assign a key

This commit is contained in:
zicodxx 2010-07-05 07:31:03 +00:00
parent d87c4ab289
commit 8a7e7de051
2 changed files with 10 additions and 3 deletions

View file

@ -1,5 +1,9 @@
D1X-Rebirth Changelog D1X-Rebirth Changelog
20100705
--------
main/kconfig.c: Fixing issue when assigning mouse button if a citem is still pointed out; Fixing still processing key commands even if we want to assign a key
20100704 20100704
-------- --------
main/net_udp.c: Fixed Compiler-warning on Windows main/net_udp.c: Fixed Compiler-warning on Windows

View file

@ -624,6 +624,10 @@ int kconfig_key_command(window *wind, d_event *event, kc_menu *menu)
int i,k; int i,k;
k = ((d_event_keycommand *)event)->keycode; k = ((d_event_keycommand *)event)->keycode;
// when changing, process no keys instead of ESC
if (menu->changing && (k != -2 && k != KEY_ESC))
return 0;
switch (k) switch (k)
{ {
@ -795,14 +799,13 @@ int kconfig_handler(window *wind, d_event *event, kc_menu *menu)
break; break;
case EVENT_MOUSE_BUTTON_DOWN: case EVENT_MOUSE_BUTTON_DOWN:
if (menu->changing && (menu->items[menu->citem].type == BT_MOUSE_BUTTON)) case EVENT_MOUSE_BUTTON_UP:
if (menu->changing && (menu->items[menu->citem].type == BT_MOUSE_BUTTON) && (event->type == EVENT_MOUSE_BUTTON_UP))
{ {
kc_change_mousebutton( menu, event, &menu->items[menu->citem] ); kc_change_mousebutton( menu, event, &menu->items[menu->citem] );
return 1; return 1;
} }
// else fall through
case EVENT_MOUSE_BUTTON_UP:
if (mouse_get_button(event) != 0) if (mouse_get_button(event) != 0)
return 0; return 0;