Add NormalIdle hook support
This commit is contained in:
parent
38a67e72bc
commit
2235944e60
|
@ -38,9 +38,11 @@ class Normal : public InputMode
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Normal(InputHandler& input_handler)
|
Normal(InputHandler& input_handler)
|
||||||
: InputMode(input_handler)
|
: InputMode(input_handler),
|
||||||
{
|
m_idle_timer{Clock::now() + idle_timeout, [this](Timer& timer) {
|
||||||
}
|
context().hooks().run_hook("NormalIdle", "", context());
|
||||||
|
}}
|
||||||
|
{}
|
||||||
|
|
||||||
void on_key(const Key& key) override
|
void on_key(const Key& key) override
|
||||||
{
|
{
|
||||||
|
@ -56,10 +58,12 @@ public:
|
||||||
}
|
}
|
||||||
m_count = 0;
|
m_count = 0;
|
||||||
}
|
}
|
||||||
|
m_idle_timer.set_next_date(Clock::now() + idle_timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int m_count = 0;
|
int m_count = 0;
|
||||||
|
Timer m_idle_timer;
|
||||||
};
|
};
|
||||||
|
|
||||||
class LineEditor
|
class LineEditor
|
||||||
|
|
Loading…
Reference in New Issue
Block a user