Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Support for cmd-key in mac

    Hello,

    Is there a keypress event support for mac's cmd keys ? It seems the cmd key press just registers as a separate "Meta" key press.

    In addition to this what is the strategy for mapping keyidentifiers & keypresses platform independently ? Is there a way to define key identifiers for example in MenuItems in a way that on PCs key press events would be triggered with ctrl+x and on Macs with cmd+x ?

    br,
    Marko

    #2
    Hello,

    I have exactly the same question, how do you define KeyIdentifier to catch cmd-s on mac ?

    Many thanks for answering, Ben.

    Comment


      #3
      Binding a function like

      Code:
      function () { 
          if (isc.EventHandler.getKey()=="A" &&
              isc.EventHandler.modifierKeyDown()) {
                  console.log("You pressed Cmd-A/Ctrl-A"); 
                  return false;
              }
      }
      to the keyPress property of a Canvas should be a platform-independent solution, assuming the browser is letting the key combination reach JS.
      Last edited by Isomorphic; 2 Oct 2012, 15:32.

      Comment


        #4
        I know this is an old topic but I am not able to understand how to solve this problem for Smart GWT with the given solution ... Wouldn't it be simpler if you add an EventHandler.metaKeyDown() as it is for EventHandler.ctrlKeyDown() ?

        Comment


          #5
          Any update on this?

          Comment


            #6
            A solution has already been provided.

            Saying you just don’t understand it, with no further details, does not make it possible to help you.

            Comment

            Working...
            X