📄 hw_kb_core.cpp
字号:
#include "Hw_Kb_Core.h"#define HZ_PROTOCOL_ATOM "_CHINESE_CONVERSION"#define HZ_CONFIG_ATOM "_HZ_CONFIG_ATOM"#define HZCLIENT_CONFIG_KEYBOARD 24#define HZCLIENT_CONFIG_HANDWRITING 25#define HZCLIENT_CONFIG_FULL_HANDWRITING 29Atom hz_config_atom;Atom hz_protocol_atom;extern FL_EXPORT Display *fl_display;void config_inputbar(Window twin, int flag, int n1, int n2, int n3){ hz_config_atom = XInternAtom(fl_display, HZ_CONFIG_ATOM, False); XClientMessageEvent event; event.type = ClientMessage; event.message_type=hz_config_atom; event.format=32; event.data.l[0] = flag; event.data.l[1] = n1; event.data.l[2] = n2; event.data.l[3] = n3; XSendEvent(fl_display, twin, True, 0, (XEvent *)&event);}void config_keyboard(int flag,int x,int y){ Window twin; hz_protocol_atom = XInternAtom(fl_display, HZ_PROTOCOL_ATOM,False); twin = XGetSelectionOwner(fl_display,hz_protocol_atom); if(twin == None) return; config_inputbar(twin, HZCLIENT_CONFIG_KEYBOARD, flag, x, y);}void config_mouse(){ Window twin; hz_protocol_atom = XInternAtom(fl_display, HZ_PROTOCOL_ATOM,False); twin = XGetSelectionOwner(fl_display,hz_protocol_atom); if(twin == None) return; config_inputbar(twin, HZCLIENT_CONFIG_HANDWRITING, 0, 0, 0);}void config_handwriting(){ Window twin; hz_protocol_atom = XInternAtom(fl_display, HZ_PROTOCOL_ATOM,False); twin = XGetSelectionOwner(fl_display,hz_protocol_atom); if(twin == None) return; config_inputbar(twin, HZCLIENT_CONFIG_FULL_HANDWRITING, 0, 0, 0);}void close_chinput(){ config_mouse(); config_keyboard(2,Fl::event_x_root(),Fl::event_y_root());}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -