systemevent

AppleScript Application is not allowed to send keystrokes

感情迁移 提交于 2020-12-29 10:55:23
问题 I made an app with AppleScript called FRIDAY. When I tell it to 'open chrome', it opens google chrome, this is working on Script Editor and out side of script editor. I can also tell it to 'open a new tab' and it opens a new tab using keystrokes: -- this boolean is the reason this script keeps runing set condition to false say "Welcome sir" set commands to {"what is todays date", "what time is it", "what is the time", "what day is it", "what month is it", "which month is it", "friday you up",

Emulate / send Modifier Key (Cntrl, Alt, fn, Shift) in OSx

南笙酒味 提交于 2019-12-22 19:01:12
问题 I am sending keyboard key press and key release events, which works for all keyboard keys. But modifier keys works only when the key associated with modifier key is sent from application, and not from real hardware. That is if I send Shift and 'a' from application, it prints 'A' (capital A, which is what is expected). But if I send 'shift' key down event from application, and enter 'a' from physical keyboard, it prints 'a' (the shift key doesn't seem to be working across different devices).

Sleep(suspend) and Resuming windows form starts program on worker thread instead of main thread

孤者浪人 提交于 2019-12-22 12:53:41
问题 The windows form I am working on subscribes to Microsoft.Win32.SystemEvents.PowerModeChanged and on Suspend it runs the Close() method on the form. On Resume it runs the Run() function like it would on initial load. The problem is that when the computer is woken from sleep mode the PowerModeChanged event is triggered on a worker thread named ".Net SystemEvents" and when Run() is called it recreates the form on this worker thread instead of the main thread. This form is a project I inherited

Thread hook procedure is no longer called after pressing Tab several times. Why?

两盒软妹~` 提交于 2019-12-19 03:49:20
问题 I installed a thread-specific windows hook to monitor messages sent to WndProc. It worked at first. However, after I pressed Tab about 19 times to move focus around a form, my hook callback is nolonger called. This happened regaless of whether I pressed Tab quickly or slowly. Can anybody explain what is really going on? Below is the code I wrote. I tested it on Windows 7 64 bit. using System; using System.Collections.Generic; using System.Linq; using System.Windows.Forms; using System.Runtime

Getting notified when the datetime changes in c#

这一生的挚爱 提交于 2019-12-07 09:00:34
问题 Recently I was trying to make a calendar application that will display the current year-month-date to the user. The problem is, if the user is gonna keep my application running even for the next day, how do I get notified ?? How shall I change the date displayed ? I don't wanna poll the current date to update it. Is this possible in c#. Note: I tried out the SystemEvent.TimeChanged event, but it works only if the user manually changes the time / date from the control panel. 回答1: Can you

Sleep(suspend) and Resuming windows form starts program on worker thread instead of main thread

大兔子大兔子 提交于 2019-12-06 11:28:15
The windows form I am working on subscribes to Microsoft.Win32.SystemEvents.PowerModeChanged and on Suspend it runs the Close() method on the form. On Resume it runs the Run() function like it would on initial load. The problem is that when the computer is woken from sleep mode the PowerModeChanged event is triggered on a worker thread named ".Net SystemEvents" and when Run() is called it recreates the form on this worker thread instead of the main thread. This form is a project I inherited from another developer and I am new to windows form programming. I am wondering if there is a better way

Emulate / send Modifier Key (Cntrl, Alt, fn, Shift) in OSx

梦想的初衷 提交于 2019-12-06 04:28:28
I am sending keyboard key press and key release events, which works for all keyboard keys. But modifier keys works only when the key associated with modifier key is sent from application, and not from real hardware. That is if I send Shift and 'a' from application, it prints 'A' (capital A, which is what is expected). But if I send 'shift' key down event from application, and enter 'a' from physical keyboard, it prints 'a' (the shift key doesn't seem to be working across different devices). The same applies for other modifier keys such as cmd, alt, and fn keys!. Is there a way to send modifier

Getting notified when the datetime changes in c#

霸气de小男生 提交于 2019-12-05 17:45:41
Recently I was trying to make a calendar application that will display the current year-month-date to the user. The problem is, if the user is gonna keep my application running even for the next day, how do I get notified ?? How shall I change the date displayed ? I don't wanna poll the current date to update it. Is this possible in c#. Note: I tried out the SystemEvent.TimeChanged event, but it works only if the user manually changes the time / date from the control panel. Can you simply work out the number of seconds until midnight, and then sleep for that long? @OddThinking's answer will