keyboard-hook

C# Mono - Low Level Keyboard Hook

て烟熏妆下的殇ゞ 提交于 2019-12-01 18:24:08
I'm using code that I found on the CodeProject.com for a low-level keyboard hook . The only problem is it uses external DLL calls that don't work in mono. I was wondering if anyone knew of a way to accomplish the same thing as that code, but will run in both Windows using .net, and Linux using mono? Edit: Clarifying what I'm trying to do: I'm making a Dashboard like application . The program sits in the system tray and when the user presses the hot-key, it will pop up all the gadgets. So the program doesn't have focus, so typically it won't catch any keystrokes, so I'm using the low-level

WIN7 Keyboard hook stops working in another user account?

点点圈 提交于 2019-12-01 14:44:17
I created my own parental control app using C# to monitor my kids activity. It logs all the keyboard input and screens in the background silently, with the only gui of taskbar icon. So far, I just let it run in my admin account and everybody share the same account and it works fine. The problem is that as kids grow up, they found a way to kill it from the task manager. So, I need to use a more sophisticated way to protect my app. I thought I could solve this problem easily by creating a separate standard account for each kid and I can setup my app to run as an admin to monitor all their

WIN7 Keyboard hook stops working in another user account?

时光怂恿深爱的人放手 提交于 2019-12-01 12:51:10
问题 I created my own parental control app using C# to monitor my kids activity. It logs all the keyboard input and screens in the background silently, with the only gui of taskbar icon. So far, I just let it run in my admin account and everybody share the same account and it works fine. The problem is that as kids grow up, they found a way to kill it from the task manager. So, I need to use a more sophisticated way to protect my app. I thought I could solve this problem easily by creating a

How do you implement global keyboard hooks in Mac OS X?

别说谁变了你拦得住时间么 提交于 2019-11-30 21:20:18
I know this can be done for Windows and that XGrabKey can be used for X11, but what about Mac OS X? I want create a class that allows setting shortcut keys that can be invoked even when the application windows are inactive. Take a look at addGlobalMonitorForEventsMatchingMask:handler: class methods of NSEvent . Also you may find Shortcut Recorder handy. This is not (yet?) supported in Cocoa. You can still use the old Carbon library for this (which is 64 bit compatible), but unfortunately Apple decided to remove all documentation on the subject. There's a nice blog article here: http:/

Can I change a user's keyboard input?

纵然是瞬间 提交于 2019-11-30 19:10:34
I found this keyboard hook code, which I'm trying to slightly modify for my purposes: http://blogs.msdn.com/toub/archive/2006/05/03/589423.aspx As an overview, I want to have the user press a key, say 'E', and have the keyboard return a different character, 'Z', to whatever app is in focus. The relevant method I changed now looks like: private static IntPtr HookCallback(int nCode, IntPtr wParam, IntPtr lParam) { if (nCode >= 0 && wParam == (IntPtr)WM_KEYDOWN) { //The truely typed character: int vkCode = Marshal.ReadInt32(lParam); Console.WriteLine((Keys)vkCode); KBDLLHOOKSTRUCT replacementKey

Monitoring keyboard activity in C# while my application is in the background

微笑、不失礼 提交于 2019-11-30 17:50:17
First of all I need to make it clear that I have no interest in keylogging. I need a way to monitor keyboard activity at the most basic level while my application is in the background. I don't need to know which keys, I don't need to save any data, I don't need or plan to hide my application at all, all I need is to know when keys are pressed and invoke a method. I'm looking for the simplest way to do this possible, I know a reasonable amount of C# but nothing too complex as most of my knowledge is self-taught. I've looked around for some appropriate ways of doing this and I've found nothing

Adobe AIR Keyboard Hook

柔情痞子 提交于 2019-11-30 16:22:35
I'm trying to add a feature to my AIR app that can listen for (configurable) global keyboard events even when the app is minimized. Ex: CTRL-ALT-SHIFT-F12 to grab a screenshot. I can't find any way to register a keyboard hook, and listening for keyboard events only captures them when the app has focus. Suggestions? I don't think that Adobe Air programs can process keypress events unless the application is in focus. http://forums.adobe.com/thread/420446 Even this question regarding a Global handler for keypresses states that the application must be in focus. Try hooking onto the stage's

Is it possible to detect when a low-level keyboard hook has been automatically disconnected by Windows?

﹥>﹥吖頭↗ 提交于 2019-11-30 13:45:01
I am working on a program that uses keyboard hooks. However, when the PC that the program is running on is just slightly overloaded, it causes Windows to disconnect the hook from the program, causing it to no longer respond to keystrokes. Is there a way to prevent this, or even better, propose a different way of solving the exact same problem, by using a different architecture, maybe involving a pipeline? You can't "detect" this, and you absolutely shouldn't need to. What you're describing is a feature, specifically one introduced in Windows 7 to protect your system from rogue applications.

global keyboard hooks in c

不羁的心 提交于 2019-11-30 10:33:29
i want to write a global keyboard hook to disallow task switching.When i googled i found a whole lot of codes in c#,cpp (and delphi), but i need some basic concepts about hooking (would be the best if examples are in C).So, kindly suggest the resources,links that can help me understand the thing in C's perspective. PS: I found one good working example (works on winXP and older versions),but when i tried compiling the code it gives me: And i tried searching the "IDC_" constants in all the headers(default ones that come with MinGW gcc installation and the ones provided by developer),but no luck.

How do you implement global keyboard hooks in Mac OS X?

依然范特西╮ 提交于 2019-11-30 05:45:56
问题 I know this can be done for Windows and that XGrabKey can be used for X11, but what about Mac OS X? I want create a class that allows setting shortcut keys that can be invoked even when the application windows are inactive. 回答1: Take a look at addGlobalMonitorForEventsMatchingMask:handler: class methods of NSEvent . Also you may find Shortcut Recorder handy. 回答2: This is not (yet?) supported in Cocoa. You can still use the old Carbon library for this (which is 64 bit compatible), but