MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "module.h"
if (list->next == NULL) {
/* only one way to generate the combo, good */
rec = list->data;
+ g_slist_free(list);
return expand_key(rec->key, out);
}
}
rec = list->data;
+ g_slist_free(list);
if (!expand_key(rec->key, out)) {
/* illegal key combo, remove from list */
expand_out_free(*out);
expand_out_char(*out, *key);
expand_out_char(*out, '-');
last_hyphen = FALSE; /* optional */
- } else if (last_hyphen && i_isalnum(*key) && !i_isdigit(*key)) {
+ } else if (last_hyphen && i_isalpha(*key)) {
/* possibly beginning of keycombo */
start = key;
last_hyphen = FALSE;
g_strconcat(keyboard->key_state, "-", key, NULL);
g_free_and_null(keyboard->key_state);
-#if GLIB_MAJOR_VERSION == 2
-# define GSearchFunc GCompareFunc
-#endif
rec = g_tree_search(key_states,
- (GSearchFunc) key_states_search,
+ (GCompareFunc) key_states_search,
combo);
if (rec == NULL) {
/* unknown key combo, eat the invalid key
printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, TXT_BIND_FOOTER);
}
-/* SYNTAX: BIND [-delete] [<key> [<command> [<data>]]] */
+/* SYNTAX: BIND [-list] [-delete] [<key> [<command> [<data>]]] */
static void cmd_bind(const char *data)
{
GHashTable *optlist;
"bind", &optlist, &key, &id, &keydata))
return;
+ if (g_hash_table_lookup(optlist, "list")) {
+ GSList *tmp;
+
+ for (tmp = keyinfos; tmp != NULL; tmp = tmp->next) {
+ KEYINFO_REC *rec = tmp->data;
+
+ printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, TXT_BIND_COMMAND_LIST,
+ rec->id, rec->description ? rec->description : "");
+ }
+ cmd_params_free(free_arg);
+ return;
+ }
+
if (*key != '\0' && g_hash_table_lookup(optlist, "delete")) {
/* delete key */
key_configure_remove(key);
key_config_frozen = 0;
memset(used_keys, 0, sizeof(used_keys));
- key_bind("command", "Run any IRC command", NULL, NULL, (SIGNAL_FUNC) sig_command);
+ key_bind("command", "Run any command", NULL, NULL, (SIGNAL_FUNC) sig_command);
key_bind("key", "Specify name for key binding", NULL, NULL, (SIGNAL_FUNC) sig_key);
key_bind("multi", "Run multiple commands", NULL, NULL, (SIGNAL_FUNC) sig_multi);
key_bind("nothing", "Do nothing", NULL, NULL, (SIGNAL_FUNC) sig_nothing);
signal_add("complete command bind", (SIGNAL_FUNC) sig_complete_bind);
command_bind("bind", NULL, (SIGNAL_FUNC) cmd_bind);
- command_set_options("bind", "delete");
+ command_set_options("bind", "delete list");
}
void keyboard_deinit(void)