Skip to content

Commit

Permalink
Run keystroke on release
Browse files Browse the repository at this point in the history
  • Loading branch information
madeso committed Mar 13, 2024
1 parent 33a2e4f commit a9b8bff
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions libs/ride/src/ride/app.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,6 @@ struct RideApp : api::App
ViewFilesystem browser;
KeyBind keybind;

void on_key_pressed(const api::Stroke& key) override
{
std::cout << "key pressed: " << to_string(key) << "\n";
keybind.run(key, &commands);
}

void setup_view(View* view)
{
view->theme = &theme;
Expand Down Expand Up @@ -160,6 +154,12 @@ struct RideApp : api::App
add_move_select("alt+right", "word-end");
}

void on_key_released(const api::Stroke& stroke) override
{
std::cout << "key pressed: " << to_string(stroke) << "\n";
this->keybind.run(stroke, &commands);
}

void draw(api::Renderer* cache) override
{
auto rect = Rect<Dp>::from_size(client_size);
Expand Down

0 comments on commit a9b8bff

Please sign in to comment.