Skip to content

Commit 4c23efa

Browse files
committed
Ignore "-char to prevent escaping the commands used for math and search
1 parent cdde3ac commit 4c23efa

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/input.c

+8-4
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@ static void reset_selection(struct tofi *tofi);
2626

2727
void input_handle_keypress(struct tofi *tofi, xkb_keycode_t keycode)
2828
{
29-
if (tofi->xkb_state == NULL) {
30-
return;
31-
}
32-
3329
bool ctrl = xkb_state_mod_name_is_active(
3430
tofi->xkb_state,
3531
XKB_MOD_NAME_CTRL,
@@ -43,6 +39,14 @@ void input_handle_keypress(struct tofi *tofi, xkb_keycode_t keycode)
4339
XKB_MOD_NAME_SHIFT,
4440
XKB_STATE_MODS_EFFECTIVE);
4541

42+
if (tofi->xkb_state == NULL) {
43+
return;
44+
}
45+
// Ignore "-char to prevent escaping the commands used for math and search
46+
if (11 == keycode && shift) {
47+
return;
48+
}
49+
4650
uint32_t ch = xkb_state_key_get_utf32(tofi->xkb_state, keycode);
4751

4852
/*

0 commit comments

Comments
 (0)