Comments (9)
Thank you again for your bug report and insightful comments. I think you are right that simply checking for the presence of the ctrl modifier was not enough. I have built a new version which explicitly checks that only ctrl and a numeric key are pressed. Could you please download the updated Keypad Layout and give it a test? I plan to release this as Keypad Layout 1.6 once I have your feedback on this.
from keypad-layout.
Can anyone confirm this? Taking a screenshot with ctrl + cmd + shift + 4 works for me when Keypad Layout 1.5 is running on macOS 10.12.6.
from keypad-layout.
from keypad-layout.
Can you report this to Apple as a macOS bug and post the Radar ID? I will merge your workaraound if this is not fixed in the final release of 10.13.
from keypad-layout.
If I understand it I can. You're saying that normally that function would normally not be called with the kCGEventFlagMaskControl
if shift is also pressed? My workaround simply just checks if shift is also pressed, and if so skips activating the rest of your placement code. But I really know very little about these APIs, and without further understanding I doubt I'm able to write a good bug report.
from keypad-layout.
In theory this could also be a bug in your software, where the evaluation order of hooks into keypresses have changed somewhat with 10.13, and that if worked previously by pure chance. But again, I know little about this.
from keypad-layout.
Specifically checking for the shift key or even all keys the the program should not react to seems to be an odd requirement. That's why I think we are using the API correctly here. A bug report at Apple would be our best chance to see if the change in 10.13 is intended or accidental. I am no longer a registered developer, so I cannot create the bug report myself.
from keypad-layout.
I'm not sure I agree. Your hotkeyCallback
simply checks if the ctrl key is depressed together with a number key (ctrl-numberkey). If so, you "steal" the event, if not you pass it on to the next application.
So imagine another application doing the same, like the built in cmd-shift-control-numberkey for grabbing stuff from the screen. It checks specifically for all those keys (cmd, shift, control + numberkey), and only grabs the event if everything matches.
If your application ONLY checks for the cmd-numberkey sequence and nothing else, if YOUR application is "in front" of the built in application checking for all the keys, the built in application will never receive any events. Which is pretty much the bug as I've described it.
My workaround is lazy; I just add one additional requirement (that the shift key is not depressed), but in theory I should check for all of them (to avoid stealing somebody else who might have hooked onto cmd-control-numberkey for instance).
If my understanding is correct, the application as is works by chance on older macOS releases, simply because the system checks for cmd-shift-control-numberkey BEFORE the event gets passed to your app. The order might have changed in 10.13, where they run it by user applications BEFORE system applications, and that perfectly explains what is happening.
Which is why I can't report it as a bug until I have some additional information about why this bug isn't in this app itself.
from keypad-layout.
Seems to work great, good job!
from keypad-layout.
Related Issues (16)
- Add GIF to README.md HOT 2
- Split Screen not working on multiple monitors HOT 1
- Allow reversability of keypad grid HOT 3
- use the same number twice to maximize window HOT 1
- Window Scaling with Dock on Side HOT 3
- Support for multiple screens HOT 5
- Installation is failed using latest Homebrew
- Version 1.8 binary doesn't open in macOS 11 HOT 3
- Starting from launcher does not work, but from terminal, it does work HOT 8
- Changed code signature in version 1.11? HOT 2
- Make `brew` installable HOT 2
- Split screen HOT 9
- Support for 10.10/10.11? HOT 5
- statusbar icon with numbers
- Version 1.2 Release Binary doesn't open HOT 2
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 keypad-layout.