diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-10-30 14:43:35 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-10-30 14:43:40 +0200 |
commit | f22ee7c9ac27fe05649219535a05c21281709607 (patch) | |
tree | 549046a2f91e96805cd326efa81749cbc9ca9cda /src | |
parent | b1e9b313f6810afbadde0f8079326ecf04c89817 (diff) |
Cleanup
Diffstat (limited to 'src')
-rw-r--r-- | src/ui/documentwidget.c | 12 | ||||
-rw-r--r-- | src/ui/keys.c | 5 |
2 files changed, 2 insertions, 15 deletions
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c index a2bea17b..11568c70 100644 --- a/src/ui/documentwidget.c +++ b/src/ui/documentwidget.c | |||
@@ -1569,18 +1569,6 @@ static iBool handleCommand_DocumentWidget_(iDocumentWidget *d, const char *cmd) | |||
1569 | smoothDuration_DocumentWidget_); | 1569 | smoothDuration_DocumentWidget_); |
1570 | return iTrue; | 1570 | return iTrue; |
1571 | } | 1571 | } |
1572 | #if 0 | ||
1573 | case SDLK_PAGEUP: | ||
1574 | case SDLK_PAGEDOWN: | ||
1575 | case SDLK_SPACE: | ||
1576 | postCommand_Widget( | ||
1577 | w, | ||
1578 | "scroll.page arg:%d repeat:%d", | ||
1579 | (key == SDLK_SPACE && mods & KMOD_SHIFT) || key == SDLK_PAGEUP ? -1 : +1, | ||
1580 | ev->key.repeat != 0); | ||
1581 | return iTrue; | ||
1582 | } | ||
1583 | #endif | ||
1584 | else if (equal_Command(cmd, "document.goto") && document_App() == d) { | 1572 | else if (equal_Command(cmd, "document.goto") && document_App() == d) { |
1585 | const iRangecc heading = range_Command(cmd, "heading"); | 1573 | const iRangecc heading = range_Command(cmd, "heading"); |
1586 | if (heading.start) { | 1574 | if (heading.start) { |
diff --git a/src/ui/keys.c b/src/ui/keys.c index d46d20bf..4d52b0a4 100644 --- a/src/ui/keys.c +++ b/src/ui/keys.c | |||
@@ -65,15 +65,14 @@ static void bindDefaults_(void) { | |||
65 | bind_Keys("scroll.step arg:-1", SDLK_UP, 0); | 65 | bind_Keys("scroll.step arg:-1", SDLK_UP, 0); |
66 | bind_Keys("scroll.step arg:1", SDLK_DOWN, 0); | 66 | bind_Keys("scroll.step arg:1", SDLK_DOWN, 0); |
67 | bind_Keys("scroll.page arg:-1", SDLK_PAGEUP, 0); | 67 | bind_Keys("scroll.page arg:-1", SDLK_PAGEUP, 0); |
68 | bind_Keys("scroll.page arg:-1", SDLK_SPACE, KMOD_SHIFT); | ||
69 | bind_Keys("scroll.page arg:1", SDLK_PAGEDOWN, 0); | 68 | bind_Keys("scroll.page arg:1", SDLK_PAGEDOWN, 0); |
69 | bind_Keys("scroll.page arg:-1", SDLK_SPACE, KMOD_SHIFT); | ||
70 | bind_Keys("scroll.page arg:1", SDLK_SPACE, 0); | 70 | bind_Keys("scroll.page arg:1", SDLK_SPACE, 0); |
71 | } | 71 | } |
72 | 72 | ||
73 | static iBinding *find_Keys_(iKeys *d, int key, int mods) { | 73 | static iBinding *find_Keys_(iKeys *d, int key, int mods) { |
74 | const iBinding bind = { .key = key, .mods = mods }; | ||
75 | size_t pos; | 74 | size_t pos; |
76 | if (locate_SortedArray(&d->bindings, &bind, &pos)) { | 75 | if (locate_SortedArray(&d->bindings, &(iBinding){ .key = key, .mods = mods }, &pos)) { |
77 | return at_SortedArray(&d->bindings, pos); | 76 | return at_SortedArray(&d->bindings, pos); |
78 | } | 77 | } |
79 | return NULL; | 78 | return NULL; |