diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2016-11-29 21:35:53 +0000 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2016-11-29 21:59:36 +0000 |
| commit | 3a81260917319e15b13e4f09dd9bc38f0b72b194 (patch) | |
| tree | f79d0cf3c7546f217281e9112b635096af57d507 /src/user_interface.hh | |
| parent | 2fd1414b051cc95d0e0a4cd8c983c92408e67ac8 (diff) | |
Simplify greatly UI input handling
This round trip through an input callback expected to call
is_key_available and get_key was overcomplicated, just send the
keys as they arrive, the client is already buffering due to urgent
event mode.
Diffstat (limited to 'src/user_interface.hh')
| -rw-r--r-- | src/user_interface.hh | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/user_interface.hh b/src/user_interface.hh index 51f75bbd..38abaefd 100644 --- a/src/user_interface.hh +++ b/src/user_interface.hh @@ -33,7 +33,7 @@ enum class InfoStyle enum class EventMode; -using InputCallback = std::function<void(EventMode mode)>; +using OnKeyCallback = std::function<void(Key key)>; class UserInterface { @@ -60,12 +60,10 @@ public: const Face& default_face) = 0; virtual DisplayCoord dimensions() = 0; - virtual bool is_key_available() = 0; - virtual Key get_key() = 0; virtual void refresh(bool force) = 0; - virtual void set_input_callback(InputCallback callback) = 0; + virtual void set_on_key(OnKeyCallback callback) = 0; using Options = IdMap<String, MemoryDomain::Options>; virtual void set_ui_options(const Options& options) = 0; |
