1
Fork 0
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:
Andreas Kling 2019-01-12 05:20:56 +01:00
parent 52e019f9aa
commit fd4e86460b
5 changed files with 31 additions and 36 deletions

View file

@ -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;