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:
parent
9d3abbbf32
commit
74674220ff
|
@ -1,5 +1,9 @@
|
|||
D2X-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
|
||||
--------
|
||||
SConstruct: Fixing Windows build which was not linking against SDL
|
||||
|
|
|
@ -664,7 +664,11 @@ int kconfig_key_command(window *wind, d_event *event, kc_menu *menu)
|
|||
int i,k;
|
||||
|
||||
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)
|
||||
{
|
||||
case KEY_CTRLED+KEY_D:
|
||||
|
@ -842,14 +846,13 @@ int kconfig_handler(window *wind, d_event *event, kc_menu *menu)
|
|||
break;
|
||||
|
||||
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] );
|
||||
return 1;
|
||||
}
|
||||
// else fall through
|
||||
|
||||
case EVENT_MOUSE_BUTTON_UP:
|
||||
if (mouse_get_button(event) != 0)
|
||||
return 0;
|
||||
|
||||
|
|
Loading…
Reference in a new issue