Comments (3)
There's no built-in support for this. Most use-cases for Command+Tab is for local events, where you don't need this package.
You could do it yourself though. Just use https://swiftpackageindex.com/sindresorhus/keyboardshortcuts/main/documentation/keyboardshortcuts/keyboardshortcuts/events(for:) and make an interval timer on key down and stop it on key up.
from keyboardshortcuts.
Thanks for the prompt response, but I don't understand the solution provided 😅
Let's say I want to replicate the functionality of Command+Tab
with Command+Control+Tab
.
After Command+Control+Tab
is recognized, what should I check in the timer?
This is the function I try to replicate.
- After
Command+Tab
, I want to show opened app. - While holding
Command
, you can releaseTab
. - Press
Tab
again would move the selection. - Release both
Command
andTab
will select and dismiss the window.
from keyboardshortcuts.
You could maybe register Command+Tab as a global keyboard shortcut, and then have a check for whether the Command key is still pressed, and hide the window if not.
Or you could check for NSEvent.modifierFlags.contains(.command)
in keyUp.
from keyboardshortcuts.
Related Issues (20)
- No such module 'Carbon.HIToolbox' HOT 6
- [Answered] Is it possible to capture the eject key on Magic Keyboard A1644? HOT 3
- How to change the Recorder size in swiftUI HOT 2
- Support `keyDown` when NSMenu is open on macOS 14
- unable to build signed build with xcodebuild
- If I don't need global shortcut keys, how do I configure them? HOT 2
- Add ability to override a key name (Change _ to "Space") HOT 2
- Unable to continue HOT 1
- closing the Settings while having the KeyboardShortcuts Recorded focused makes the KeyboardShortcut not work HOT 2
- the KeyboardShortcut Recorder still gets the focus by default in certain cases HOT 8
- Can I still use the spacebar for spacing after setting it as a shortcut key? HOT 2
- is there any (easy hehe) way to prevent the KeyboardShortcut to respond when the user is on the status item(s) of the app HOT 3
- Is it possible to trigger a shortcut key continuously by holding it down? HOT 1
- I hope show system-wide keyboard shortcut name HOT 1
- @State is not updated when used in App HOT 1
- Complying with Encryption Export Regulations HOT 1
- Fail to listen for Caps Lock HOT 1
- Slovak translation HOT 2
- Dynamic keyboard shortcuts? HOT 1
- Annotate `Shortcut/description` with @MainActor to prevent crashes
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from keyboardshortcuts.