mirror of
https://github.com/perfect-dark-pc-port/perfect_dark.git
synced 2026-10-24 00:02:43 +02:00
port: allow pressing DEL to delete the binding
This commit is contained in:
1 parent
4a0296d1a4
commit
a802d2db06
2 files changed
+11
-2
No files matched your search
@@ -20,6 +20,7 @@ enum virtkey {
|
||||
VK_KEYBOARD_BEGIN = 0,
|
||||
VK_RETURN = 40,
|
||||
VK_ESCAPE = 41,
|
||||
VK_DELETE = 76,
|
||||
|
||||
/* same order as SDL mouse buttons */
|
||||
VK_MOUSE_BEGIN = 512,
|
||||
|
||||
+10
-2
@@ -773,11 +773,19 @@ struct menuitem g_ExtendedBindKeyMenuItems[] = {
|
||||
0,
|
||||
menuhandlerDoBind,
|
||||
},
|
||||
{
|
||||
MENUITEMTYPE_SELECTABLE,
|
||||
0,
|
||||
MENUITEMFLAG_SELECTABLE_CENTRE | MENUITEMFLAG_LITERAL_TEXT,
|
||||
(uintptr_t)"ESC to cancel, DEL to remove binding\n",
|
||||
0,
|
||||
menuhandlerDoBind,
|
||||
},
|
||||
{ MENUITEMTYPE_END },
|
||||
};
|
||||
|
||||
struct menudialogdef g_ExtendedBindKeyMenuDialog = {
|
||||
MENUDIALOGTYPE_WHITE,
|
||||
MENUDIALOGTYPE_SUCCESS,
|
||||
(uintptr_t)"Bind",
|
||||
g_ExtendedBindKeyMenuItems,
|
||||
NULL,
|
||||
@@ -882,7 +890,7 @@ static MenuItemHandlerResult menuhandlerDoBind(s32 operation, struct menuitem *i
|
||||
|
||||
const s32 key = inputGetLastKey();
|
||||
if (key && key != VK_ESCAPE) {
|
||||
inputKeyBind(g_BindsPlayer, g_BindContKey, g_BindIndex, key);
|
||||
inputKeyBind(g_BindsPlayer, g_BindContKey, g_BindIndex, (key == VK_DELETE ? 0 : key));
|
||||
menuPopDialog();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user