Small refactorings
This commit is contained in:
parent
5c77e1aa22
commit
27591b5a52
6
events.c
6
events.c
@ -92,7 +92,7 @@ void on_keypress(XKeyEvent *kev) {
|
|||||||
XLookupString(kev, &key, 1, &ksym, NULL);
|
XLookupString(kev, &key, 1, &ksym, NULL);
|
||||||
|
|
||||||
for (i = 0; i < LEN(keys); i++) {
|
for (i = 0; i < LEN(keys); i++) {
|
||||||
if (keymask(&keys[i], kev->state) && ksym == keys[i].ksym) {
|
if (keys[i].ksym == ksym && keymask(&keys[i], kev->state)) {
|
||||||
if (keys[i].handler && keys[i].handler(keys[i].arg))
|
if (keys[i].handler && keys[i].handler(keys[i].arg))
|
||||||
redraw();
|
redraw();
|
||||||
return;
|
return;
|
||||||
@ -111,8 +111,8 @@ void on_buttonpress(XButtonEvent *bev) {
|
|||||||
timo_cursor = TO_CURSOR_HIDE;
|
timo_cursor = TO_CURSOR_HIDE;
|
||||||
|
|
||||||
for (i = 0; i < LEN(buttons); i++) {
|
for (i = 0; i < LEN(buttons); i++) {
|
||||||
if (buttonmask(&buttons[i], bev->state) &&
|
if (buttons[i].button == bev->button &&
|
||||||
bev->button == buttons[i].button)
|
buttonmask(&buttons[i], bev->state))
|
||||||
{
|
{
|
||||||
if (buttons[i].handler && buttons[i].handler(buttons[i].arg))
|
if (buttons[i].handler && buttons[i].handler(buttons[i].arg))
|
||||||
redraw();
|
redraw();
|
||||||
|
Loading…
Reference in New Issue
Block a user