capslock

hak的使用

邮差的信 提交于 2019-12-02 05:48:33
autohotkey 简称ahk    它是一款轻量级的脚本语言文件,它可以干任何事情,如做dnf的连发脚本,类似按键精灵的自动化点击,按键自动打开文件一系列事情,文件需要按照ahk自己的语言,实现自定义的脚本宏 https://www.autohotkey.com/ 下载 http://ahkcn.sourceforge.net/docs/AutoHotkey.htm 使用操作 个人定义的代码 ;replace CapsLock to LeftEnter; CapsLock = Alt CapsLock $CapsLock::Enter LAlt & Capslock::SetCapsLockState, % GetKeyState("CapsLock", "T") ? "Off" : "On" !u::Send ^c !{tab} ^v; ;######################################### ; 键盘控制鼠标 # ;######################################### ; MouseMove, X, Y [, Speed, R] ; 鼠标移动的目标位置的 x/y 坐标, 可以为 表达式. 坐标相对于活动窗口 ; Speed ; 移动鼠标的速度,介于 0(最快)和 100(最慢)之间,可以为表达式。 ; 注:速度为 0

How to call a keyboard key press programmatically?

流过昼夜 提交于 2019-12-01 20:52:08
问题 Problem : Calling a keyboard key to be pressed, from a piece of C# code but here's the catch: the key-press should not be limited to the process/application but received by the entire operating system, so also when the program is in the background and a different form/program has focus Goal : make a program that locks the state of CapsLock and NumLock Background : I have a laptop, and these 2 keys frustrate me to much, I want to make a application that runs in the background, and that

How to call a keyboard key press programmatically?

蓝咒 提交于 2019-12-01 19:11:12
Problem : Calling a keyboard key to be pressed, from a piece of C# code but here's the catch: the key-press should not be limited to the process/application but received by the entire operating system, so also when the program is in the background and a different form/program has focus Goal : make a program that locks the state of CapsLock and NumLock Background : I have a laptop, and these 2 keys frustrate me to much, I want to make a application that runs in the background, and that disables CapsLock as soon as it gets accidentally enabled, and for NumLock to never be disabled, also, I want

Programmatically disable caps lock

做~自己de王妃 提交于 2019-12-01 17:38:01
I'm using SendKeys in an automation program for work. I've been plodding along, and am now trying to iron out all the bugs that I've created :-) One of which, is that when I used SendKeys.Send("Test"), if the CapsLock is on, it will produce "tEST" as opposed to "Test". I've used the following code to attempt to detect the capsLock state, and toggle it if necessary: bool tmp = Control.IsKeyLocked(Keys.CapsLock); if (tmp) { keybd_event(0x14, 0x45, KEYEVENTF_EXTENTEDKEY, (UIntPtr)0); keybd_event(0x14, 0x45, KEYEVENTF_EXTENTEDKEY | KEYEVENTF_KEYUP, (UIntPtr)0); //Application.DoEvents(); <-Testing.

Programmatically disable caps lock

℡╲_俬逩灬. 提交于 2019-12-01 17:02:20
问题 I'm using SendKeys in an automation program for work. I've been plodding along, and am now trying to iron out all the bugs that I've created :-) One of which, is that when I used SendKeys.Send("Test"), if the CapsLock is on, it will produce "tEST" as opposed to "Test". I've used the following code to attempt to detect the capsLock state, and toggle it if necessary: bool tmp = Control.IsKeyLocked(Keys.CapsLock); if (tmp) { keybd_event(0x14, 0x45, KEYEVENTF_EXTENTEDKEY, (UIntPtr)0); keybd_event

Does anyone know where OSX stores the settings in System Preferences > Keyboard > Modifier Keys?

萝らか妹 提交于 2019-12-01 09:25:49
I'm apparently not the only one who wants to know ( How can I change modifier keys in "System Preferences > Keyboard > Modifier Keys..." ). I've tried watching the System Preferences app with dtruss, but that doesn't seem to be possible on 10.10.3 (which is what I'm on right now), and I'm not even sure that that would be at all useful if System Preferences is just getting settings from cfprefsd. Watching cfprefsd with dtruss doesn't seem to catch the relevant file access. Does anyone know of an API to get this information? Something in gestalt perhaps? Ok - answering my own question. I threw

using GetKeyState(VK_CAPITAL) & 1 in linux

久未见 提交于 2019-12-01 08:31:26
#include <windows.h> int main() { if ( !GetKeyState(VK_CAPITAL) & 1 ) { printf("caps off"); } else printf("caps on"); return 0; } but limited to windows only how to do this in linux with gcc ? what is & 1 in GetKeyState(VK_CAPITAL) & 1 ? For the most common case of an X11-based desktop: #include <stdio.h> #include <X11/XKBlib.h> int main() { Display * d = XOpenDisplay((char*)0); if (d) { unsigned n; XkbGetIndicatorState(d, XkbUseCoreKbd, &n); printf((n & 1)?"caps on\n":"caps off\n"); } } Make sure you have the X11 development headers and compile with: $ gcc -lX11 test.c -o test Run it from a

How to change caps lock status without key press

余生颓废 提交于 2019-11-30 12:38:01
I am using a python program that is activate when pressing Caps Lock key and I want to be able to turn on/off the caps lock status when the program is active. I tried to send keys with virtkey but it obviously don't work since the keys just activate the app and don't change the caps lock status. So what is the best way to achieve this with python? I'm using Ubuntu Daniel Vassallo On Linux: import fcntl import os KDSETLED = 0x4B32 console_fd = os.open('/dev/console', os.O_NOCTTY) # Turn on caps lock fcntl.ioctl(console_fd, KDSETLED, 0x04) # Turn off caps lock fcntl.ioctl(console_fd, KDSETLED, 0

分享一波目前写的最强的autohotkey 插件

余生颓废 提交于 2019-11-30 01:21:47
支持各种软件快速切换,补全括号,代码等!!!!!!!! ;这种全局定义要写在所有代码的前面才能让所有代码起作用. SetCapsLockState , AlwaysOff SetNumlockState, AlwaysOn SetTitleMatchMode, 2 SetTitleMatchMode, slow #b:: run https://www.google.com/ return ;需要写一个按照像素移动鼠标的功能,做cv用,当然photoshop也可以使用. CapsLock & Up:: MouseMove, 0, -1, 100, R return CapsLock & Down:: MouseMove, 0, 1, 100, R return CapsLock & Left:: MouseMove, -1, 0, 100, R return CapsLock & Right:: MouseMove, 1, 0, 100, R return CapsLock & 9:: send ,{PgUp} return CapsLock & 0:: send ,{PgDn} return CapsLock & u:: send ,{backspace} return CapsLock & o:: send ,{del} return ;如何选中光标当前字

How to change caps lock status without key press

心已入冬 提交于 2019-11-29 17:35:08
问题 I am using a python program that is activate when pressing Caps Lock key and I want to be able to turn on/off the caps lock status when the program is active. I tried to send keys with virtkey but it obviously don't work since the keys just activate the app and don't change the caps lock status. So what is the best way to achieve this with python? I'm using Ubuntu 回答1: On Linux: import fcntl import os KDSETLED = 0x4B32 console_fd = os.open('/dev/console', os.O_NOCTTY) # Turn on caps lock