mirror of
https://github.com/kunkundi/crossdesk.git
synced 2025-10-26 12:15:34 +08:00
32 lines
630 B
C++
32 lines
630 B
C++
/*
|
|
* @Author: DI JUNKUN
|
|
* @Date: 2024-11-22
|
|
* Copyright (c) 2024 by DI JUNKUN, All Rights Reserved.
|
|
*/
|
|
|
|
#ifndef _KEYBOARD_CAPTURER_H_
|
|
#define _KEYBOARD_CAPTURER_H_
|
|
|
|
#include <X11/Xlib.h>
|
|
#include <X11/extensions/XTest.h>
|
|
#include <X11/keysym.h>
|
|
|
|
#include "device_controller.h"
|
|
|
|
class KeyboardCapturer : public DeviceController {
|
|
public:
|
|
KeyboardCapturer();
|
|
virtual ~KeyboardCapturer();
|
|
|
|
public:
|
|
virtual int Hook(OnKeyAction on_key_action, void *user_ptr);
|
|
virtual int Unhook();
|
|
virtual int SendKeyboardCommand(int key_code, bool is_down);
|
|
|
|
private:
|
|
Display *display_;
|
|
Window root_;
|
|
bool running_;
|
|
};
|
|
|
|
#endif |