Commits

rmtew committed f1eede8

Fix identify, enchant and other item selections where cursor keys were not working, and only hotkeys worked.

Comments (0)

Files changed (2)

 			buttons[b].hotkey[0] = CALL_KEY;
 			b++;
 		}
-		
-		// Add invisible previous and next buttons, so up and down arrows can page through items.
-		// Previous
+	}	
+#ifdef BROGUEX_FEATURES
+	else {
+		// Select
 		buttons[b].flags = B_ENABLED; // clear everything else
-		buttons[b].hotkey[0] = UP_KEY;
-		buttons[b].hotkey[1] = NUMPAD_8;
-		buttons[b].hotkey[2] = UP_ARROW;
+		buttons[b].hotkey[1] = ENTER_KEY;
+		buttons[b].hotkey[0] = RETURN_KEY;
 		b++;
-		// Next
-		buttons[b].flags = B_ENABLED; // clear everything else
-		buttons[b].hotkey[0] = DOWN_KEY;
-		buttons[b].hotkey[1] = NUMPAD_2;
-		buttons[b].hotkey[2] = DOWN_ARROW;
-		b++;
-	}	
+	}
+#endif
+
+	// Add invisible previous and next buttons, so up and down arrows can page through items.
+	// Previous
+	buttons[b].flags = B_ENABLED; // clear everything else
+	buttons[b].hotkey[0] = UP_KEY;
+	buttons[b].hotkey[1] = NUMPAD_8;
+	buttons[b].hotkey[2] = UP_ARROW;
+	b++;
+	// Next
+	buttons[b].flags = B_ENABLED; // clear everything else
+	buttons[b].hotkey[0] = DOWN_KEY;
+	buttons[b].hotkey[1] = NUMPAD_2;
+	buttons[b].hotkey[2] = DOWN_ARROW;
+	b++;
+
 	b = printTextBox(textBuf, x, y, width, &white, &interfaceBoxColor, rbuf, buttons, b);
-	
+
+#ifndef BROGUEX_FEATURES
 	if (!includeButtons) {
 		waitForKeystrokeOrMouseClick();
 		return -1;
 	}
-	
+#endif
+
 	if (b >= 0) {
 		return buttons[b].hotkey[0];
 	} else {

BrogueCode/Items.c

 						default:
 							break;
 					}
-					
+
+#ifdef BROGUEX_FEATURES
+					if (actionKey == ENTER_KEY || actionKey == RETURN_KEY)
+						break;
+#endif
 					if (actionKey == UP_KEY || actionKey == DOWN_KEY) {
 						theKey = itemList[highlightItemLine]->inventoryLetter;
 						theItem = itemList[highlightItemLine];