Skip to content

Commit

Permalink
Send focus status to kakoune client
Browse files Browse the repository at this point in the history
  • Loading branch information
falbru committed Mar 25, 2024
1 parent 74a60fc commit 6ae1793
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/kakounetextedit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,3 +210,13 @@ void KakouneTextEdit::resizeEvent(QResizeEvent *ev)
m_client->resize(height() / m_draw_options->getCellSize().height(),
width() / m_draw_options->getCellSize().width());
}

void KakouneTextEdit::focusInEvent(QFocusEvent *ev)
{
m_client->sendKeys("<focus_in>");
}

void KakouneTextEdit::focusOutEvent(QFocusEvent *ev)
{
m_client->sendKeys("<focus_out>");
}
2 changes: 2 additions & 0 deletions src/kakounetextedit.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ class KakouneTextEdit : public QWidget
void mousePressEvent(QMouseEvent *ev) override;
void mouseReleaseEvent(QMouseEvent *ev) override;
void resizeEvent(QResizeEvent *ev) override;
void focusInEvent(QFocusEvent *ev) override;
void focusOutEvent(QFocusEvent *ev) override;

private:
KakouneClient *m_client;
Expand Down

0 comments on commit 6ae1793

Please sign in to comment.