diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-11-24 14:09:53 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-11-24 14:09:53 +0200 |
commit | 6a52923f7090f947cef15f9f42b622ef34d73722 (patch) | |
tree | 2152a60543c91b3fb843365c76fd598321c92b8b /src/ui | |
parent | 2fa433ad7c61389b9b950ce4ee2f8d9f0340ff80 (diff) |
InputWidget: Ctrl+A to select all (on PC)
The Emacs-style Ctrl+A and Ctrl+E are only available on macOS now.
This could still use a keybinding for customizing the behavior.
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/inputwidget.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/ui/inputwidget.c b/src/ui/inputwidget.c index 6c84b161..301fd220 100644 --- a/src/ui/inputwidget.c +++ b/src/ui/inputwidget.c | |||
@@ -2161,11 +2161,7 @@ static iBool processEvent_InputWidget_(iInputWidget *d, const SDL_Event *ev) { | |||
2161 | refresh_Widget(w); | 2161 | refresh_Widget(w); |
2162 | return iTrue; | 2162 | return iTrue; |
2163 | case SDLK_a: | 2163 | case SDLK_a: |
2164 | #if defined (iPlatformApple) | ||
2165 | if (mods == KMOD_PRIMARY) { | 2164 | if (mods == KMOD_PRIMARY) { |
2166 | #else | ||
2167 | if (mods == (KMOD_PRIMARY | KMOD_SHIFT)) { | ||
2168 | #endif | ||
2169 | selectAll_InputWidget(d); | 2165 | selectAll_InputWidget(d); |
2170 | d->mark.start = 0; | 2166 | d->mark.start = 0; |
2171 | d->mark.end = cursorToIndex_InputWidget_(d, curMax); | 2167 | d->mark.end = cursorToIndex_InputWidget_(d, curMax); |
@@ -2174,6 +2170,7 @@ static iBool processEvent_InputWidget_(iInputWidget *d, const SDL_Event *ev) { | |||
2174 | refresh_Widget(w); | 2170 | refresh_Widget(w); |
2175 | return iTrue; | 2171 | return iTrue; |
2176 | } | 2172 | } |
2173 | #if defined (iPlatformApple) | ||
2177 | /* fall through for Emacs-style Home/End */ | 2174 | /* fall through for Emacs-style Home/End */ |
2178 | case SDLK_e: | 2175 | case SDLK_e: |
2179 | if (mods == KMOD_CTRL || mods == (KMOD_CTRL | KMOD_SHIFT)) { | 2176 | if (mods == KMOD_CTRL || mods == (KMOD_CTRL | KMOD_SHIFT)) { |
@@ -2182,6 +2179,7 @@ static iBool processEvent_InputWidget_(iInputWidget *d, const SDL_Event *ev) { | |||
2182 | return iTrue; | 2179 | return iTrue; |
2183 | } | 2180 | } |
2184 | break; | 2181 | break; |
2182 | #endif | ||
2185 | case SDLK_LEFT: | 2183 | case SDLK_LEFT: |
2186 | case SDLK_RIGHT: { | 2184 | case SDLK_RIGHT: { |
2187 | const int dir = (key == SDLK_LEFT ? -1 : +1); | 2185 | const int dir = (key == SDLK_LEFT ? -1 : +1); |