Keyboard Shortcuts in the Pretty HTML Editor

Jump to solution
KOliveras
Community Participant

Apologies if this has been asked elsewhere, but in trying out the new "Pretty HTML" feature, I have been unable to paste text using keyboard shortcuts.  So, my questions are as follows: 

  1. Is there a keyboard shortcut for pasting text into the pretty HTML editor? I can right click and select paste from the menu, but I'm specifically looking for a keyboard shortcut. 
  2. Is there documentation available for the keyboard shortcuts in the pretty html editor? In trying various combinations to find an option for pasting text, I did discover a few unexpected keyboard shortcuts actions. I'm curious as to what set of keyboard short cuts exist "under the hood" so to speak.  
1 Solution
and-hu
Community Participant

For the people with issues, are you using touchscreen computers/laptops?

@KOliveras I took a further look at the CodeMirror.js file and from the way is written, we should only get the emacs bindings (which are one of the 2 fallthroughs in keyMap.macDefault) in the case where mac is true in this statement.

 

keyMap["default"] = mac ? keyMap.macDefault : keyMap.pcDefault;

 

mac is defined as:

 

 var mac = ios || /Mac/.test(platform);

 

So, it's true iOS if true or platform has Mac in (platform is a variable that is equal to navigator.platform, which you can run in your web console. Mine evaluated to false).

Next, iOS is defined as: 

 

var ios = !edge && /AppleWebKit/.test(userAgent) && (/Mobile\/\w+/.test(userAgent) || navigator.maxTouchPoints > 2);

 

Which is true is your userAgent doesn't have "Edge" in it (that's what edge checks for, and Chrome doesn't), if your userAgent has AppleWebKit in it (which Chrome does, but Firefox does not), and if your useragent has mobile in it (Chrome doesn't) OR it has a navigator.maxTouchPoints > 2.

In my laptop that isn't working, a touchscreen Windows 10 laptop, navigator.maxTouchPoints is 10. In the work-issued laptop, which is working properly, this is 1.

So, there are probably other issues, but it looks like one of them is that the code identifies us as iOS, and then Mac users, so defaults to the macDefault. The macDefault fallthrough probably tests some other aspects of Macs that we fail, so we get stuck with the eMacs ones. Ultimately then, this looks like a bug Canvas has to fix.

View solution in original post