AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Using windows keyboard for mac3/12/2023 ![]() You should now be able to use your shortcut to perform a right-click. Look for your service (it should be near the bottom of the list) and assign a keyboard shortcut. Go to System Preferences → Keyboard → Shortcuts → Services. Use a descriptive name like "Perform a right-click". MouseEvent(kCGEventRightMouseUp, int(position.x), int(position.y)) ![]() MouseEvent(kCGEventRightMouseDown, int(position.x), int(position.y)) Similarly, the Mac keyboard’s Delete key corresponds to the Windows Backspace or Backward Delete key to delete forward, you can (on Mac keyboards with a number pad) press the Forward Delete key. TheEvent = CGEventCreateMouseEvent(None, type, (posx,posy), kCGMouseButtonRight) Paste the following code into the Run Shell Script action: from Quartz.CoreGraphics import CGEventCreateMouseEvent, kCGMouseButtonRight, CGEventPost, kCGHIDEventTap, CGEventCreate, kCGEventRightMouseDown, kCGEventRightMouseUp, CGEventGetLocation Search for "shell" and drag the "Run Shell Script" action to the storyboard: ![]() It's a bit slower than a real mouse (~0.5 second delay), but it works and requires no third-party software.Ĭhoose Service receives no input in any application. Here's a solution using Automator and Python.
0 Comments
Read More
Leave a Reply. |