home · contact · privacy
Fixed bug that led to endless loop in nearest_enemy_dir().
[plomrogue] / src / control.h
index bd5dd0ce36a8b94743cc872fd7aefe69cfa2eca8..492b80b1688f8ad176dd57adc7397cac11d86661 100644 (file)
@@ -1,22 +1,32 @@
 /* control.h
  *
- * Routines for handling user's key press input.
+ * Routines for handling control input from keyboard or record file.
  */
 
 #ifndef CONTROL_H
 #define CONTROL_H
 
+#include <stdint.h> /* for uint8_t */
 
 
-#include <stdint.h> /* for uint8_t */
-struct World;
 
+/* Return keycode to action of "name" if available in current window config. */
+extern uint16_t get_available_keycode_to_action(char * name);
+
+/* Control the player character, either via action id "action" or pressed "key".
+ * Return 1 on success, 0 if no appropriate action to trigger was found.
+ */
+extern uint8_t player_control_by_key(int key);
+extern uint8_t player_control_by_id(int action);
 
+/* Control via "key" active window's config view's geometry / keybindings. */
+extern uint8_t wingeom_control(int key);
+extern uint8_t winkeyb_control(int key);
 
-/* Call some meta game / window management actions dependent on key. If the
- * "quit" action is called, return 1 only instead of doing anything directly.
+/* Call via "key" further game/window management actions not influencing the
+ * player character. If "quit" is called, return 1, else 0.
  */
-extern uint8_t meta_keys(int key, struct World * world);
+extern uint8_t meta_control(int key);