mirror of
https://github.com/kunkundi/crossdesk.git
synced 2026-11-04 13:02:39 +08:00
[feat] add HarmonyOS desktop and mobile clients,issue #117
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* @Author: DI JUNKUN
|
||||
* @Date: 2026-10-15
|
||||
* Copyright (c) 2026 by DI JUNKUN, All Rights Reserved.
|
||||
*/
|
||||
|
||||
#ifndef _KEYBOARD_HOOK_H_
|
||||
#define _KEYBOARD_HOOK_H_
|
||||
|
||||
#include "device_controller.h"
|
||||
#include <multimodalinput/oh_input_manager.h>
|
||||
|
||||
namespace crossdesk::harmony::desktop {
|
||||
// Process-wide OS hook; the shared SessionDeviceManager owns when it runs.
|
||||
// ArkUI updates focus immediately, even while the Slint thread waits for an OS
|
||||
// service. A late callback must never capture input for another application.
|
||||
void SetKeyboardFocus(int window, bool active);
|
||||
void SetKeyboardHookPermission(bool granted);
|
||||
bool KeyboardHookPermissionGranted();
|
||||
class KeyboardHook {
|
||||
public:
|
||||
~KeyboardHook();
|
||||
int Start(OnKeyAction callback, void* context);
|
||||
int Stop();
|
||||
bool Active() const;
|
||||
private:
|
||||
static void Receive(const Input_KeyEvent* event);
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user