void keyboard_init(void) { keys = g_hash_table_new((GHashFunc) g_str_hash, (GCompareFunc) g_str_equal); keyinfos = NULL; key_bind("command", NULL, "Run any IRC command", NULL, (SIGNAL_FUNC) sig_command); read_keyboard_config(); signal_add("setup reread", (SIGNAL_FUNC) read_keyboard_config); }
/* _pckeys_init: * Initialises the scancode translation routines, loading mapping tables * from keyboard.dat. */ void _pckeys_init(void) { int i; _key_accent1 = 0; _key_accent2 = 0; _key_accent3 = 0; _key_accent4 = 0; _key_accent1_flag = 0; _key_accent2_flag = 0; _key_accent3_flag = 0; _key_accent4_flag = 0; key_extended = FALSE; key_altgr = FALSE; key_pad_seq = 0; key_pause_loop = 0; key_paused = FALSE; for (i=0; i<KEY_MAX; i++) standard_key_empty_table[i] = 0; memcpy(custom_key_ascii_table, standard_key_ascii_table, sizeof(custom_key_ascii_table)); memcpy(custom_key_capslock_table, standard_key_capslock_table, sizeof(custom_key_capslock_table)); memcpy(custom_key_shift_table, standard_key_shift_table, sizeof(custom_key_shift_table)); memcpy(custom_key_control_table, standard_key_control_table, sizeof(custom_key_control_table)); memcpy(custom_key_altgr_lower_table, standard_key_empty_table, sizeof(custom_key_altgr_lower_table)); memcpy(custom_key_altgr_upper_table, standard_key_empty_table, sizeof(custom_key_altgr_upper_table)); memcpy(custom_key_accent1_lower_table, standard_key_empty_table, sizeof(custom_key_accent1_lower_table)); memcpy(custom_key_accent1_upper_table, standard_key_empty_table, sizeof(custom_key_accent1_upper_table)); memcpy(custom_key_accent2_lower_table, standard_key_empty_table, sizeof(custom_key_accent2_lower_table)); memcpy(custom_key_accent2_upper_table, standard_key_empty_table, sizeof(custom_key_accent2_upper_table)); memcpy(custom_key_accent3_lower_table, standard_key_empty_table, sizeof(custom_key_accent1_lower_table)); memcpy(custom_key_accent3_upper_table, standard_key_empty_table, sizeof(custom_key_accent1_upper_table)); memcpy(custom_key_accent4_lower_table, standard_key_empty_table, sizeof(custom_key_accent2_lower_table)); memcpy(custom_key_accent4_upper_table, standard_key_empty_table, sizeof(custom_key_accent2_upper_table)); update_key_descriptions(); LOCK_VARIABLE(hw_to_mycode); LOCK_VARIABLE(hw_to_mycode_ex); LOCK_VARIABLE(modifier_table); LOCK_VARIABLE(numlock_table); LOCK_VARIABLE(standard_key_ascii_table); LOCK_VARIABLE(standard_key_capslock_table); LOCK_VARIABLE(standard_key_shift_table); LOCK_VARIABLE(standard_key_control_table); LOCK_VARIABLE(standard_key_empty_table); LOCK_VARIABLE(custom_key_ascii_table); LOCK_VARIABLE(custom_key_capslock_table); LOCK_VARIABLE(custom_key_shift_table); LOCK_VARIABLE(custom_key_control_table); LOCK_VARIABLE(custom_key_altgr_lower_table); LOCK_VARIABLE(custom_key_altgr_upper_table); LOCK_VARIABLE(custom_key_accent1_lower_table); LOCK_VARIABLE(custom_key_accent1_upper_table); LOCK_VARIABLE(custom_key_accent2_lower_table); LOCK_VARIABLE(custom_key_accent2_upper_table); LOCK_VARIABLE(custom_key_accent3_lower_table); LOCK_VARIABLE(custom_key_accent3_upper_table); LOCK_VARIABLE(custom_key_accent4_lower_table); LOCK_VARIABLE(custom_key_accent4_upper_table); LOCK_VARIABLE(_key_ascii_table); LOCK_VARIABLE(_key_capslock_table); LOCK_VARIABLE(_key_shift_table); LOCK_VARIABLE(_key_control_table); LOCK_VARIABLE(_key_altgr_lower_table); LOCK_VARIABLE(_key_altgr_upper_table); LOCK_VARIABLE(_key_accent1_lower_table); LOCK_VARIABLE(_key_accent1_upper_table); LOCK_VARIABLE(_key_accent2_lower_table); LOCK_VARIABLE(_key_accent2_upper_table); LOCK_VARIABLE(_key_accent3_lower_table); LOCK_VARIABLE(_key_accent3_upper_table); LOCK_VARIABLE(_key_accent4_lower_table); LOCK_VARIABLE(_key_accent4_upper_table); LOCK_VARIABLE(_key_standard_kb); LOCK_VARIABLE(key_extended); LOCK_VARIABLE(key_altgr); LOCK_VARIABLE(key_pad_seq); LOCK_VARIABLE(key_pause_loop); LOCK_VARIABLE(key_paused); LOCK_VARIABLE(_key_accent1); LOCK_VARIABLE(_key_accent2); LOCK_VARIABLE(_key_accent3); LOCK_VARIABLE(_key_accent4); LOCK_VARIABLE(_key_accent1_flag); LOCK_VARIABLE(_key_accent2_flag); LOCK_VARIABLE(_key_accent3_flag); LOCK_VARIABLE(_key_accent4_flag); LOCK_FUNCTION(_handle_pckey); _key_standard_kb = TRUE; read_keyboard_config(); }