From: terencehill Date: Thu, 1 Jul 2010 22:41:46 +0000 (+0200) Subject: Use numpad enter key and add other 2 instances of numpad keys in the menu. X-Git-Tag: xonotic-v0.1.0preview~465^2~3 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=0218563b4059e788652d927ef6e8ce738c055ba1;p=xonotic%2Fxonotic-data.pk3dir.git Use numpad enter key and add other 2 instances of numpad keys in the menu. --- diff --git a/qcsrc/menu/item/button.c b/qcsrc/menu/item/button.c index 728413135..3d91229ec 100644 --- a/qcsrc/menu/item/button.c +++ b/qcsrc/menu/item/button.c @@ -50,7 +50,7 @@ void Button_configureButton(entity me, string txt, float sz, string gfx) } float Button_keyDown(entity me, float key, float ascii, float shift) { - if(key == K_ENTER || key == K_SPACE) + if(key == K_ENTER || key == K_SPACE || key == K_KP_ENTER) { me.clickTime = 0.1; // delayed for effect return 1; diff --git a/qcsrc/menu/item/nexposee.c b/qcsrc/menu/item/nexposee.c index c43f44f50..2369a4107 100644 --- a/qcsrc/menu/item/nexposee.c +++ b/qcsrc/menu/item/nexposee.c @@ -309,7 +309,7 @@ float Nexposee_keyDown(entity me, float scan, float ascii, float shift) { case 0: case 3: - nexposeeKey = ((scan == K_SPACE) || (scan == K_ENTER)); + nexposeeKey = ((scan == K_SPACE) || (scan == K_ENTER) || (scan == K_KP_ENTER)); break; case 1: case 2: diff --git a/qcsrc/menu/xonotic/campaign.c b/qcsrc/menu/xonotic/campaign.c index bd31f435e..e7667f69c 100644 --- a/qcsrc/menu/xonotic/campaign.c +++ b/qcsrc/menu/xonotic/campaign.c @@ -315,7 +315,7 @@ void XonoticCampaignList_setSelected(entity me, float i) float XonoticCampaignList_keyDown(entity me, float scan, float ascii, float shift) { - if(scan == K_ENTER || scan == K_SPACE) + if(scan == K_ENTER || scan == K_SPACE || scan == K_KP_ENTER) CampaignList_LoadMap(me, me); else return SUPER(XonoticCampaignList).keyDown(me, scan, ascii, shift); diff --git a/qcsrc/menu/xonotic/charmap.c b/qcsrc/menu/xonotic/charmap.c index a448e3547..0e375c9cc 100644 --- a/qcsrc/menu/xonotic/charmap.c +++ b/qcsrc/menu/xonotic/charmap.c @@ -122,6 +122,7 @@ float XonoticCharmap_keyDown(entity me, float key, float ascii, float shift) return 1; case K_SPACE: case K_ENTER: + case K_KP_ENTER: case K_INS: case K_KP_INS: me.controlledTextbox.enterText(me.controlledTextbox, CharMap_CellToChar(me.selectedCharacterCell)); diff --git a/qcsrc/menu/xonotic/demolist.c b/qcsrc/menu/xonotic/demolist.c index 0882a3ed4..c16e4ae00 100644 --- a/qcsrc/menu/xonotic/demolist.c +++ b/qcsrc/menu/xonotic/demolist.c @@ -155,7 +155,7 @@ void XonoticDemoList_clickListBoxItem(entity me, float i, vector where) float XonoticDemoList_keyDown(entity me, float scan, float ascii, float shift) { - if(scan == K_ENTER) { + if(scan == K_ENTER || scan == K_KP_ENTER) { me.startDemo(me); return 1; } diff --git a/qcsrc/menu/xonotic/inputbox.c b/qcsrc/menu/xonotic/inputbox.c index 26dc4536c..e457414b4 100644 --- a/qcsrc/menu/xonotic/inputbox.c +++ b/qcsrc/menu/xonotic/inputbox.c @@ -74,7 +74,7 @@ float XonoticInputBox_keyDown(entity me, float key, float ascii, float shift) { float r; r = 0; - if(key == K_ENTER) + if(key == K_ENTER || key == K_KP_ENTER) { if(me.cvarName) { diff --git a/qcsrc/menu/xonotic/keybinder.c b/qcsrc/menu/xonotic/keybinder.c index 2eb51755d..01ed3a553 100644 --- a/qcsrc/menu/xonotic/keybinder.c +++ b/qcsrc/menu/xonotic/keybinder.c @@ -240,10 +240,12 @@ float XonoticKeyBinder_keyDown(entity me, float key, float ascii, float shift) switch(key) { case K_ENTER: + case K_KP_ENTER: case K_SPACE: KeyBinder_Bind_Change(me, me); break; case K_DEL: + case K_KP_DEL: case K_BACKSPACE: KeyBinder_Bind_Clear(me, me); break; diff --git a/qcsrc/menu/xonotic/maplist.c b/qcsrc/menu/xonotic/maplist.c index 7a5a4ba15..8b5ce6d6a 100644 --- a/qcsrc/menu/xonotic/maplist.c +++ b/qcsrc/menu/xonotic/maplist.c @@ -295,7 +295,7 @@ void MapList_LoadMap(entity btn, entity me) float XonoticMapList_keyDown(entity me, float scan, float ascii, float shift) { string ch, save; - if(scan == K_ENTER) + if(scan == K_ENTER || scan == K_KP_ENTER) { // pop up map info screen main.mapInfoDialog.loadMapInfo(main.mapInfoDialog, me.selectedItem, me); diff --git a/qcsrc/menu/xonotic/serverlist.c b/qcsrc/menu/xonotic/serverlist.c index c205fba70..d721c2555 100644 --- a/qcsrc/menu/xonotic/serverlist.c +++ b/qcsrc/menu/xonotic/serverlist.c @@ -582,7 +582,7 @@ float XonoticServerList_keyDown(entity me, float scan, float ascii, float shift) org = boxToGlobal(eY * (me.selectedItem * me.itemHeight - me.scrollPos), me.origin, me.size); sz = boxToGlobalSize(eY * me.itemHeight + eX * (1 - me.controlWidth), me.size); - if(scan == K_ENTER) + if(scan == K_ENTER || scan == K_KP_ENTER) { ServerList_Connect_Click(NULL, me); return 1; @@ -592,7 +592,7 @@ float XonoticServerList_keyDown(entity me, float scan, float ascii, float shift) main.serverInfoDialog.loadServerInfo(main.serverInfoDialog, me.selectedItem); DialogOpenButton_Click_withCoords(me, main.serverInfoDialog, org, sz); } - else if(scan == K_INS || scan == K_MOUSE3) + else if(scan == K_INS || scan == K_MOUSE3 || scan == K_KP_INS) { i = me.selectedItem; if(i < me.nItems) diff --git a/qcsrc/menu/xonotic/skinlist.c b/qcsrc/menu/xonotic/skinlist.c index bcb62251a..864b3054a 100644 --- a/qcsrc/menu/xonotic/skinlist.c +++ b/qcsrc/menu/xonotic/skinlist.c @@ -195,7 +195,7 @@ void XonoticSkinList_clickListBoxItem(entity me, float i, vector where) float XonoticSkinList_keyDown(entity me, float scan, float ascii, float shift) { - if(scan == K_ENTER) { + if(scan == K_ENTER || scan == K_KP_ENTER) { me.setSkin(me); return 1; }