0

I need to catch the combination of Apple + C in GWT NativePreviewHandler

Here is the code that use to catch CTRL + C and it works:

nativeEventsHandlerRegistration = Event.addNativePreviewHandler(new Event.NativePreviewHandler() {

    @Override
    public void onPreviewNativeEvent(Event.NativePreviewEvent event) {

        NativeEvent nativeEvent = event.getNativeEvent();

        if (Event.getTypeInt(nativeEvent.getType()) == Event.ONKEYDOWN) {
            if (nativeEvent.getCtrlKey() && 'C' == nativeEvent.getKeyCode()) {      
                // do something
            }
        }

    }

});

I need the same thing but for MAC, any ideas?

Kara
  • 6,115
  • 16
  • 50
  • 57
David Tolioupov
  • 173
  • 2
  • 9

1 Answers1

1

There was already a discussion very similar to yours at stackoverflow go check it out:

How does one capture a Mac's command key via JavaScript?

Community
  • 1
  • 1
Vjeetje
  • 5,314
  • 5
  • 35
  • 57