#ifndef UI_EVENTS_KEYBOARD_EVENT_COUNTER_H_
#define UI_EVENTS_KEYBOARD_EVENT_COUNTER_H_
#include <stddef.h>
#include <stdint.h>
#include <atomic>
#include <set>
#include "ui/events/events_export.h"
#include "ui/events/keycodes/keyboard_codes.h"
#include "ui/events/types/event_type.h"
namespace ui {
class EVENTS_EXPORT KeyboardEventCounter {
public:
KeyboardEventCounter();
KeyboardEventCounter(const KeyboardEventCounter&) = delete;
KeyboardEventCounter& operator=(const KeyboardEventCounter&) = delete;
~KeyboardEventCounter();
uint32_t GetKeyPressCount() const;
void OnKeyboardEvent(EventType event, KeyboardCode key_code);
private:
std::set<KeyboardCode> pressed_keys_;
std::atomic<uint32_t> total_key_presses_;
};
}
#endif