Skip to content

Commit

Permalink
fix for weird CmdPeriod behavior
Browse files Browse the repository at this point in the history
using ctrl/cmd-. produced zomby nodes when global shortcuts were
enabled. This fix seems to have solved the issue by avoiding adding a
new CmdPeriod action any time ctrl/cmd-. is hit

Signed-off-by:  <st9fan@gmail.com>
(cherry picked from commit 23bf4a3)
Signed-off-by: Stefan Nussbaumer <st9fan@gmail.com>
  • Loading branch information
nuss committed Jun 7, 2014
1 parent 2abf5e1 commit 0d48874
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions CVCenter/KeyDownActions.sc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ KeyDownActions {
// classvar <allEditors;
// classvar <viewActions;
classvar <>keyCodes, <>modifiersQt, <>modifiersCocoa, <>arrowsModifiersQt, <>arrowsModifiersCocoa;
classvar <>globalShortcuts, <globalShortcutsEnabled=true;
classvar <>globalShortcuts, <globalShortcutsEnabled=true, globalShortcutsEnableFunc;
classvar trackingSynth, syncResponder, trackingSynthID;
// var <window, <>actions;

Expand All @@ -19,6 +19,12 @@ KeyDownActions {
Class.initClassTree(SynthDescLib);
Class.initClassTree(SynthDef);

globalShortcutsEnableFunc = {
if(globalShortcutsEnabled) {
this.globalShortcutsSync;
}
};

Platform.case(
\osx, { platform = "OSX" },
\linux, { platform = "Linux" },
Expand Down Expand Up @@ -424,11 +430,9 @@ KeyDownActions {
}).add
};
// [this.method, this.method.name].postln;
CmdPeriod.add({
if(globalShortcutsEnabled) {
this.globalShortcutsSync;
}
});
CmdPeriod.objects.includes(globalShortcutsEnableFunc).not.if{
CmdPeriod.add(globalShortcutsEnableFunc)
};
"\nglobal key-down actions enabled\n".inform;
trackingSynth.newMsg;
}.value);
Expand Down

0 comments on commit 0d48874

Please sign in to comment.