mirror of
https://github.com/jscrane/r65emu.git
synced 2025-02-08 22:30:40 +00:00
* ps/2 and hardware serial keyboards * serial keyboard * add ps2_kbd shim * hardware_run() and hardware_debug_cpu() * ... * ... * updates * refactoring * refactoring * run instructions
21 lines
366 B
C++
21 lines
366 B
C++
#if !defined(__SERIAL_KBD_H__)
|
|
#define __SERIAL_KBD_H__
|
|
|
|
typedef void (*fnkey_handler)(uint8_t);
|
|
|
|
class serial_kbd {
|
|
public:
|
|
virtual int read() = 0;
|
|
virtual bool available() = 0;
|
|
virtual void reset() {}
|
|
virtual void register_fnkey_handler(fnkey_handler f) { _f = f; }
|
|
|
|
protected:
|
|
void fnkey(uint8_t k) { if (_f) _f(k); }
|
|
|
|
private:
|
|
fnkey_handler _f;
|
|
};
|
|
|
|
#endif
|