No internet connection
  1. Home
  2. How to

Mouse click with command key down

By Danny @Danny_van_Spreuwel
    2022-05-26 07:44:43.107Z

    @Kitch

    Hi, in another post I saw the same problem and was solved there. I can't seem to get it work. Without the command lines the click works but not with the modifiers code.

    //Start holding down Command
    sf.keyboard.modifiers({
        isCommand: true,
    });
    
    //Click speaker icon
    sf.ui.app("com.genelec.GLM4").mainWindow.mouseClickElement({
        relativePosition: {"x":event.props.posX,"y":event.props.posY},
    });
    
    //Release all modifiers
    sf.keyboard.modifiers();
    Solved in post #2, click to view
    • 3 replies
    1. Hi Danny,

      You need to set the "isCommand" property of the "mouseClickElement" action to true instead of using the sf.keyboard.modifiers action(s).

      Reply1 LikeSolution
      1. Ie.:

        sf.ui.app("com.genelec.GLM4").mainWindow.mouseClickElement({
            relativePosition: {"x":event.props.posX,"y":event.props.posY},
            isCommand: true,
        });
        
        1. Danny @Danny_van_Spreuwel
            2022-05-26 11:32:21.096Z

            Yes, this works! Thanks!