No internet connection
  1. Home
  2. How to

How to have SF hold down keyboard modifiers

How do you get SoundFlow to hold down keyboard modifiers?

Solved in post #2, click to view
  • 5 replies
  1. //Start holding down Shift
    sf.keyboard.modifiers({
        isShift: true
    });
    
    //Release all modifiers
    sf.keyboard.modifiers();
    
    Reply1 LikeSolution
    1. SSteve @stevef
        2018-07-28 23:21:08.351Z

        Hi. I can't seem to get this to work (on Beta 3.4). Assuming I am using it correctly. In cubase, if you hold shift and then use the down or up arrow on tracks, it adds the next or previous to the selection. So I thought if I scripted

        sf.keyboard.modifiers({
        isShift: true
        sf.keyboard.press({ keys: 'down, down, down, down' });
        sf.keyboard.modifiers();

        It would have the same effect, but it doesn't. This works:

        sf.keyboard.press({ keys: 'shift, shift+down, shift+down, shift+down, shift+down' });

        But wondered why the other isn't?

        1. Correct.
          Because the sf.keyboard.press actually resets the modifiers if you don't specify the shift. If we allowed "sticky" stuff before/after, it would break many of our internal commands, and it would more easily lead to subtle bugs.

          1. SSteve @stevef
              2018-07-28 23:23:42.052Z

              Ah, get you. This is more for shift clicking?

              1. Not sure what you mean by that :)
                The sf.keyboard.modifiers I think is probably mostly a legacy action by now. It was originally combined with mouse clicks etc., but those now have dedicated parameters to control their behavior since that is more stable.
                I'll look to see if we should completely remove the modifiers action if all it does is introduce confusion.