diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2013-09-16 18:48:41 +0100 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2013-09-16 18:48:41 +0100 |
| commit | 49903523a7f28c18d324bf605876b9d18a97047b (patch) | |
| tree | aa715653589bef142b6206ddfacb0cb138c44e19 /src | |
| parent | 27a1e70b01731d1def326db91ab7c6e236b9fe34 (diff) | |
Resurect Client::handle_available_input()
Diffstat (limited to 'src')
| -rw-r--r-- | src/client.cc | 7 | ||||
| -rw-r--r-- | src/client.hh | 3 | ||||
| -rw-r--r-- | src/client_manager.cc | 4 |
3 files changed, 11 insertions, 3 deletions
diff --git a/src/client.cc b/src/client.cc index 979d132e..aabe52eb 100644 --- a/src/client.cc +++ b/src/client.cc @@ -978,6 +978,13 @@ bool is_valid(Key key) return key != Key::Invalid and key.key <= 0x10FFFF; } +void Client::handle_available_input() +{ + while (m_ui->is_key_available()) + handle_key(m_ui->get_key()); + m_context.window().forget_timestamp(); +} + void Client::handle_key(Key key) { if (is_valid(key)) diff --git a/src/client.hh b/src/client.hh index 7c300929..ef1a178d 100644 --- a/src/client.hh +++ b/src/client.hh @@ -64,6 +64,9 @@ public: // if callback does not change the mode itself void on_next_key(KeyCallback callback); + + // handle all the keys currently available in the user interface + void handle_available_input(); // process the given key void handle_key(Key key); diff --git a/src/client_manager.cc b/src/client_manager.cc index 0f0c65e7..c50d313e 100644 --- a/src/client_manager.cc +++ b/src/client_manager.cc @@ -50,9 +50,7 @@ Client* ClientManager::create_client(std::unique_ptr<UserInterface>&& ui, client->ui().set_input_callback([client, this]() { try { - while (client->ui().is_key_available()) - client->handle_key(client->ui().get_key()); - client->context().window().forget_timestamp(); + client->handle_available_input(); } catch (Kakoune::runtime_error& error) { |
