20#include "pedigree/kernel/LockGuard.h"
21#include "pedigree/kernel/Log.h"
22#include "pedigree/kernel/machine/HidInputManager.h"
23#include "pedigree/kernel/machine/InputManager.h"
24#include "pedigree/kernel/machine/KeymapManager.h"
25#include "pedigree/kernel/machine/Machine.h"
26#include "pedigree/kernel/machine/Timer.h"
27#include "pedigree/kernel/utilities/Iterator.h"
28#include "pedigree/kernel/utilities/utility.h"
41 if (
timer && !
timer->unregisterHandler(
this)) {
42 FATAL(
"HidInputManager could not drain its timer callback");
52 for (
const void* heldSource : keyState->
sources) {
53 if (heldSource == source) {
79 ERROR(
"HidInputManager could not register key repeat");
84 keyState->
nextRepeat = Time::getTicks() + 600000000;
85 armNextRepeatLocked();
99 while (index < keyState->sources.count() && keyState->
sources[index] != source) {
115 armNextRepeatLocked();
122 const uint64_t now = Time::getTicks();
132 armNextRepeatLocked();
141 timer->unregisterHandler(
this);
145void HidInputManager::armNextRepeatLocked() {
148 const uint64_t deadline = it.value()->nextRepeat;
149 if (deadline && (!next || deadline < next)) {
157 if (next == m_NextArmed) {
161 FATAL(
"HidInputManager could not arm key repeat");
171void HidInputManager::updateKeysLocked() {
174 KeyState* keyState = it.value();
175 if (keyState->nextRepeat) {
bool handleHidModifier(uint8_t keyCode, bool bDown)
static KeymapManager & instance()
Singleton design.
uint64_t resolveHidKeycode(uint8_t keyCode)
virtual Timer * getTimer()=0
virtual bool supportsDeadlines() const
virtual bool armHandler(TimerHandler *, uint64_t)
An iterator applicable for many data structures.
void pushBack(const T &value)