code: void previewNativeEvent(NativePreviewEvent event) {
  
          Event nativeEvent = Event.as(event.getNativeEvent());
          if (event.getTypeInt() == Event.ONKEYDOWN) {
              int keyCode = nativeEvent.getKeyCode();
              if (nativeEvent.getCtrlKey() || nativeEvent.getMetaKey()) {
                  // look for short cuts
                  if (nativeEvent.getShiftKey()) {
                      if (keyCode == KeyCodes.KEY_S) {
  
                          exitWithSaving();
                          nativeEvent.preventDefault();
                          nativeEvent.stopPropagation();
                      } else if (keyCode == KeyCodes.KEY_X) {
                          confirmCancel();
                          nativeEvent.preventDefault();
                          nativeEvent.stopPropagation();
                      }
                  } else if (keyCode == KeyCodes.KEY_S) {
                      if (checkValidation()) {
                          save();
                      }
                      nativeEvent.preventDefault();
                      nativeEvent.stopPropagation();
                  }
  
              }
          }
      }
docs: Previews the native event to enable keyboard short cuts.<p>
  
  @param event the event