Generate the hardware interupt which will enable the CapsLock

*爱你&永不变心* 提交于 2019-12-11 05:58:15

问题


I want to Send my machine an hardware event so that my caps-lock key becomes enable. When I send enable interrupt, light on Caps-lock key should be on and when I send enable interrupt, light on Caps-lock key should be off.

I am using Qt, Mac, C++, Carbon.


回答1:


No need for an interrupt. The Caps Lock, Num Lock, and Scroll Lock lights are programmatically controllable.

Note that this won't actually turn the Caps Lock on (causing the user to enter all-capital text), but you shouldn't do that. If you need text input to be in a specific format, then you should make any needed repairs to it—which may include capitalizing it—yourself.




回答2:


Can you even generate a HW interrupt from a non-privileged userspace application on OS X. It sound to me as if this is something that you should request the OS to do (i.e. turn on or off Caps Lock)



来源:https://stackoverflow.com/questions/2334022/generate-the-hardware-interupt-which-will-enable-the-capslock

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!