Update copyright year.
[cboard.git] / src / keys.h
blob25d2daa0646ed170c9f2384b75b929a9969bdf90
1 /* vim:tw=78:ts=8:sw=4:set ft=c: */
2 /*
3 Copyright (C) 2002-2024 Ben Kibbey <bjk@luxsci.net>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #ifndef KEYS_H
20 #define KEYS_H
22 #define CTRL_KEY(x) ((x) & 0x1f)
23 #define KEY_ESCAPE CTRL_KEY('[')
25 enum
27 MODE_ANY = -1, MODE_HISTORY, MODE_PLAY, MODE_EDIT
30 enum
32 PLAY_HE, PLAY_EH
35 enum
37 CURSOR_POSITION, SP_POSITION, SPS_POSITION
40 typedef void (key_func) (void);
42 struct key_s
44 key_func *f;
45 wint_t c;
46 wchar_t *key;
47 wchar_t *d;
48 int r;
51 struct macro_s
53 wint_t c;
54 wint_t *keys;
55 wchar_t *desc;
56 int n;
57 int total;
58 int mode;
61 extern struct macro_s **macros;
62 extern int *macro_depth;
63 extern int macro_depth_n;
65 extern struct key_s **history_keys;
66 key_func do_history_jump_next;
67 key_func do_history_jump_prev;
68 key_func do_history_next;
69 key_func do_history_prev;
70 key_func do_history_half_move_toggle;
71 key_func do_history_rotate_board;
72 key_func do_history_jump;
73 key_func do_history_find_new;
74 key_func do_history_find_next;
75 key_func do_history_find_prev;
76 key_func do_history_annotate;
77 key_func do_history_rav_next;
78 key_func do_history_rav_prev;
79 key_func do_history_menu;
80 key_func do_history_toggle;
82 extern struct key_s **edit_keys;
83 key_func do_edit_select;
84 key_func do_edit_commit;
85 key_func do_edit_cancel_selected;
86 key_func do_edit_delete;
87 key_func do_edit_insert;
88 key_func do_edit_toggle_castle;
89 key_func do_edit_enpassant;
90 key_func do_edit_switch_turn;
91 key_func do_edit_exit;
93 extern struct key_s **play_keys;
94 key_func do_play_select;
95 key_func do_play_commit;
96 key_func do_play_cancel_selected;
97 key_func do_play_set_clock;
98 //key_func do_play_switch_turn;
99 key_func do_play_undo;
100 key_func do_play_go;
101 key_func do_play_send_command;
102 key_func do_play_toggle_eh_mode;
103 key_func do_play_toggle_engine;
104 key_func do_play_toggle_human;
105 key_func do_play_toggle_pause;
106 key_func do_play_history_mode;
107 key_func do_play_edit_mode;
108 key_func do_play_toggle_strict_castling;
110 extern struct key_s **global_keys;
111 key_func do_global_tag_edit;
112 key_func do_global_tag_view;
113 key_func do_global_find_new;
114 key_func do_global_find_next;
115 key_func do_global_find_prev;
116 key_func do_global_new_game;
117 key_func do_global_new_all;
118 key_func do_global_copy_game;
119 key_func do_global_copy_game_fen;
120 key_func do_global_next_game;
121 key_func do_global_prev_game;
122 key_func do_global_game_jump;
123 key_func do_global_toggle_delete;
124 key_func do_global_delete_game;
125 key_func do_global_resume_game;
126 key_func do_global_save_game;
127 key_func do_global_about;
128 key_func do_global_quit;
129 key_func do_global_toggle_engine_window;
130 key_func do_global_toggle_board_details;
131 key_func do_global_redraw;
132 key_func do_global_help;
133 #ifdef WITH_LIBPERL
134 key_func do_global_perl;
135 #endif
137 #endif