Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows下如何构建项目并调试? #10

Open
syy-boy opened this issue Feb 7, 2024 · 6 comments
Open

Windows下如何构建项目并调试? #10

syy-boy opened this issue Feb 7, 2024 · 6 comments
Labels
documentation Improvements or additions to documentation

Comments

@syy-boy
Copy link

syy-boy commented Feb 7, 2024

大佬好:
1、想请问一下如何在Windows下对该项目进行编译并调试的?
2、检测按键事件并进行事件处理的接口在哪?
感谢大佬解答!

@Sunrisepeak
Copy link
Owner

大佬好: 1、想请问一下如何在Windows下对该项目进行编译并调试的? 2、检测按键事件并进行事件处理的接口在哪? 感谢大佬解答!

A1:
0.获取本项目及相关库源码

git clone --recursive [email protected]:Sunrisepeak/KHistory.git 

1.安装VS 并配置C++的基础开发环境

2.安装xmake构建工具

3.到项目根目录控制台中使用xmake进行构建

xmake -f m debug
xmake 
xmake r

A2:
插件的按键状态更新接口

virtual void updateKeyStatus(const dstruct::Vector<int> &keyVec /* key's press-info */) = 0;

void updateKeyStatus(const dstruct::Vector<int> &keyVec) override {

按键检测接口

static dstruct::Vector<KeyData> platformKeyDetect(unsigned int wID);

@Sunrisepeak Sunrisepeak added the documentation Improvements or additions to documentation label Feb 7, 2024
@syy-boy
Copy link
Author

syy-boy commented Feb 27, 2024

大佬好,如何查看在代码中加入的调试打印?printf之类的

@Sunrisepeak
Copy link
Owner

大佬好,如何查看在代码中加入的调试打印?printf之类的

这个项目代码 算是 代码量比较少的 小工具, 开发的时候就没加Log打印相关的模块和控制

你可以直接使用 printf 或 std::cout 打印, 或者使用 'xmake r -d' 去调试
如下:

//std::cout << keyEvent.key << " " << keyEvent.pressed << std::endl;

@Sunrisepeak
Copy link
Owner

后面我可能会研究一下 工具的窗口悬浮功能
加这个新功能的时候, 应该能顺带加一个Log.hpp 做个小的日志 模块 LOGD / LOGW / LOGI ..... 的控制。
如果你感兴趣的话可以写个简单点的Log.hpp加进来(基本有日志等级控制就可以了)

@Sunrisepeak
Copy link
Owner

#11

@Sunrisepeak
Copy link
Owner

一个简单的工具构建文档

https://github.com/Sunrisepeak/KHistory/blob/main/docs/build.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants