mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 17:47:44 +00:00
Make PS2MouseDevice behave more like a proper character device.
Get rid of the goofy MouseClient interface and have the GUI event loop just read mouse data from the character device. The previous approach was awful as it was sending us into random GUI code in the mouse interrupt handler.
This commit is contained in:
parent
52e019f9aa
commit
fd4e86460b
5 changed files with 31 additions and 36 deletions
|
@ -6,7 +6,7 @@
|
|||
#include "Keyboard.h"
|
||||
#include "PS2MouseDevice.h"
|
||||
|
||||
class AbstractScreen : public Object, public KeyboardClient, public MouseClient {
|
||||
class AbstractScreen : public Object, public KeyboardClient {
|
||||
public:
|
||||
virtual ~AbstractScreen();
|
||||
|
||||
|
@ -24,13 +24,12 @@ public:
|
|||
bool left_mouse_button_pressed() const { return m_left_mouse_button_pressed; }
|
||||
bool right_mouse_button_pressed() const { return m_right_mouse_button_pressed; }
|
||||
|
||||
void on_receive_mouse_data(int dx, int dy, bool left_button, bool right_button);
|
||||
|
||||
protected:
|
||||
AbstractScreen(unsigned width, unsigned height);
|
||||
|
||||
private:
|
||||
// ^MouseClient
|
||||
virtual void did_receive_mouse_data(int dx, int dy, bool left_button, bool right_button) final;
|
||||
|
||||
// ^KeyboardClient
|
||||
virtual void on_key_pressed(Keyboard::Key) final;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue