keystroke

Simulate keypress using Swift

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-27 01:38:21
I'm searching for a way to simulate keystrokes in OSX. I found another solution ( Simulate keypress for system wide hotkeys ) using Objective-C, but i need to do it with Swift. How can i adapt CGEventCreateKeyboardEvent? Airspeed Velocity The code on that linked answer is fairly readily convertible to Swift code, however there are a handful of gotchas you will need to take care of along the way: CGEventSourceCreate takes a CGEventSourceStateID , which is a typealiase for a UInt32 , but the constants such as kCGEventSourceStateHIDSystemState are defined as Int , so you’ll have to cast them i.e.

Capture any kind of keystrokes (aka keylogger), preferably c# .net but any kind will do

自闭症网瘾萝莉.ら 提交于 2019-11-26 19:46:58
问题 I need to capture everything that I type on my keyboard and then store it in numerous ways. I'd prefer it to be written in C# for .Net, but anything will do really. My reasons to write this "keylogger" are simple: Recently I became an owner of a Peregrine gaming glove. It's a very cool thing that allows you to issue commands by making gestures with your fingers, and at the same time, its a very thin glove so you can type with that hand with little discomfort. Also, I have found a nice program

focus() not working in safari or chrome

我只是一个虾纸丫 提交于 2019-11-26 12:46:52
问题 I have a div that has been given a tabindex, when the div is focused(click or tabbed to) it does the following: inserts an input into itself, gives the input focus this works great in FF, IE and Opera but in Chome/Safari it gives the input focus but fails to actually put the cursor inside the input (I know it gives it focus because the safari/chrome focus borders appear). Any suggestions as to what is going on? I have to fix the key handler after this so the arrow keys and backspace keys work

How to listen keyboard in background and fire keystrokes on demand?

旧街凉风 提交于 2019-11-26 09:57:41
问题 I want to make a program in vb.NET 2008 which will listen keyboard in background, i.e. even though the application is minimized (globally). If a specific key is been pressed by user, it should keep firing 2 other keys at regular given time intervals until the user presses that specific key again. How can this be done in vb.NET 2008? 回答1: Source : Here Usage: To create the hook Private WithEvents kbHook As New KeyboardHook Then each event can be handled: Private Sub kbHook_KeyDown(ByVal Key As

Simulate keypress using Swift

醉酒当歌 提交于 2019-11-26 09:45:00
问题 I\'m searching for a way to simulate keystrokes in OSX. I found another solution (Simulate keypress for system wide hotkeys) using Objective-C, but i need to do it with Swift. How can i adapt CGEventCreateKeyboardEvent? 回答1: The code on that linked answer is fairly readily convertible to Swift code, however there are a handful of gotchas you will need to take care of along the way: CGEventSourceCreate takes a CGEventSourceStateID , which is a typealiase for a UInt32 , but the constants such

How do I send key strokes to a window without having to activate it using Windows API?

冷暖自知 提交于 2019-11-26 05:22:47
I have made an application already that sends commands to an activated window. I want to be able to use the computer while my process is running because as soon as I switch focus to another window the key strokes being sent via send keys will go to the window I just switched to. Currently I use FindWindow, IsIconic, and ShowWindow from the Windows API. I have to check to see if the window is there with FindWindow and set my object to the specific window that is returned with that call, I then check if it's minimized with IsIconic and call ShowWindow if it is, and then finally I have to call

How do I send key strokes to a window without having to activate it using Windows API?

微笑、不失礼 提交于 2019-11-26 01:54:22
问题 I have made an application already that sends commands to an activated window. I want to be able to use the computer while my process is running because as soon as I switch focus to another window the key strokes being sent via send keys will go to the window I just switched to. Currently I use FindWindow, IsIconic, and ShowWindow from the Windows API. I have to check to see if the window is there with FindWindow and set my object to the specific window that is returned with that call, I then