Comments (15)
Hi Cris, thank you for the problem report and the clear sample project. Indeed MASShortcut
is resetting the hotkey and its block while NSOutlineView
is being loaded and changing preferences. I will think how to improve the component to avoid this. Till then, please consider a workaround like loading NIB in the next run loop out of the block. Sorry for inconvenience :)
from masshortcut.
Workaround:
move all your code from the block to a method and run the method from within the block like this:
[self performSelectorOnMainThread:@selector(yourMethod) withObject:nil waitUntilDone:NO]; //if UI is involved
[self performSelectorInBackground:@selector(yourMethod) withObject:someObject]; //if no UI involved
from masshortcut.
Thank you for posting this! I was running into this same issue, and was beating my head against the wall trying to figure out what I was doing wrong. This got it!
from masshortcut.
Just want to second this issue. The workaround posted by synapse does work but it would be nice to see this fixed some time.
from masshortcut.
I think I have the same problem. It is really strange.
I call a method each time the user pressed their shortcut key, which hides and shows the current window. Pressing the shortcut works once or twice, but then it doesn't work anymore.
I've pinpointed the exact line where things go wrong and it is this one:
[[NSUserDefaults standardUserDefaults] setInteger:newNumber forKey:@"timesDisplayed"];
I have absolutely no clue why this should screw up the shortcut, but it does. Now I've put that line into a method and I'm calling that method with this:
[self performSelectorInBackground:@selector(timesDisplayed) withObject:nil];
So now the shortcut works 12-17 times before it breaks. Would be great if someone could take a look at this, because that's a major downer :-(.
Awesome library besides that.
from masshortcut.
@holgersindbaek The problem is with how the MASShortcut
component handles changes in user defaults, I will investigate into this as soon as I have time. Sorry for inconvenience guys.
from masshortcut.
Sounds great. Looking forward to it!
It's a great little library. Gonna use it much more in the future.
Holger Sindbaek
Holgersindbaek.com (http://Holgersindbaek.com)
Co-founder
Uninkd.com (http://Uninkd.com)
Meer.li (http://Meer.li)
On Tuesday, April 2, 2013 at 6:06 AM, Vadim Shpakovski wrote:
@holgersindbaek (https://github.com/holgersindbaek) The problem is with how the MASShortcut component handles changes in user defaults, I will investigate into this as soon as I have time. Sorry for inconvenience guys.
—
Reply to this email directly or view it on GitHub (#14 (comment)).
from masshortcut.
+1 on this issue, my user defaults change an unrelated key and after a time or two the shortcut is unregistered via this method
from masshortcut.
Guys, I made some changes suggested by @Keithbsmiley, so could you please try the latest commits? Does it help? Thanks in advance!
from masshortcut.
This does not seem to remove the observer from the previous shortcut after changing it
from masshortcut.
Oops, looking into this…
from masshortcut.
Done, please try again. Sorry for inconvenience!
from masshortcut.
This seems to fix all the issues I experienced 🍻
from masshortcut.
Wohoo, thanks all for your help!
from masshortcut.
Thanks for the great tool!
from masshortcut.
Related Issues (20)
- Bridging header file instructions link broken HOT 2
- Can I add a Package.swift file and use it with SPM? HOT 7
- Unconsistency between italian translation from Apple HOT 3
- Tab isn't allowed
- Is there a way I can detect Key press and hold with MASShortcut? HOT 4
- Layout issue on macOS Big Sur HOT 3
- Can't set two arrow keys as part of a shotcut HOT 2
- Not visible to VoiceOver HOT 4
- Multiple Warnings for Deprecations HOT 6
- Toggling shortcut handling? e.g. an off-mode HOT 6
- NSKeyedUnarchiveFromData deprecated warning HOT 5
- Cannot record shortcut with format ⌥+⇧+<Letter> HOT 1
- How to binding custom shortcut on MASShortcutView ?
- Getting 'Error: missing module map file' when trying to build HOT 10
- Request: Could you push a release now that you have SMP support HOT 5
- Crash -[MASShortcutView propagateValue:forBinding:]
- Double-quoted include "MASxyz.h" in framework header, expected angle-bracketed instead HOT 2
- TIS API is deprecated
- EXC_BAD_ACCESS on Monterey when using swift String for defaultsKey
- README.md: "A nice, documented API" links to deprecated cocoadocs.org 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 masshortcut.