如何实现系统软键盘的功能?

wangwei77126 2003-05-15 06:10:46
请问各位大侠:
如何做一个类似于微软的软键盘?
点击软键盘,就往当前光标所在的输入框输入键值!

非常急,各位大侠帮帮小弟!
...全文
68 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
oscar0013 2003-05-16
  • 打赏
  • 举报
回复
有人用VB做了一个软键盘,可以借签一下的啊! 到VB那快去看看吧! 帖子还在的啊!
ghtsao 2003-05-16
  • 打赏
  • 举报
回复
我查了一相帮助,基本上应该这样:
LRESULT PostMessage(
HWND hWnd, // handle to destination window
WM_KEYDOWN, // message
wParam, // first message parameter
lParam // second message parameter
);

WM_KEYDOWN nVirtKey = (int) wParam; lKeyData = lParam;

wParam
Specifies the virtual-key code of the nonsystem key.

lParam
Specifies the repeat count, context code, previous key-state flag, and transition-state flag, as shown in the following table.

0–15 Specifies the repeat count. The value is the number of times the keystroke is repeated as a result of the user holding down the key.
29 Specifies the context code. The value is 1 if the ALT key is held down while the key is pressed; otherwise, the value is 0.
30 Specifies the previous key state. The value is 1 if the key is down before the message is sent, or it is 0 if the key is up.
31 Specifies the transition state. The value is 1 if the key is being released, or it is 0 if the key is being pressed.

如果软键盘与应用不在一个线程则可能要用:
BOOL PostThreadMessage(
DWORD idThread,
UINT Msg,
WPARAM wParam,
LPARAM lParam );
ghtsao 2003-05-16
  • 打赏
  • 举报
回复
键盘输入是系统通过消息传递给当前活动控件的,所以你要做的就是在点击软键盘的时候,向那个控件窗口发送Message, SendMessage, PostMessage, 键盘事件参数怎么构造去查消息定义吧!
Robin 2003-05-15
  • 打赏
  • 举报
回复
模拟wendous的消息!

24,854

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 工具平台和程序库
社区管理员
  • 工具平台和程序库社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧