WordPress.org

Make WordPress Core

Opened 4 years ago

Last modified 5 months ago

#35932 reopened defect (bug)

Square brackets for shortcodes can't be entered with default Czech, Slovak and maybe other keyboards

Reported by: thomask Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Editor Keywords:
Focuses: ui, javascript, administration Cc:
PR Number:

Description

In Czech, Slovak, and probably some other languages, we have dedicated right alt click for writing some lesser used characters. E.g. for writing [ you need to press Right Alt plus F

And that's the problem, as this combination is in wysiwyg editor shortcut for opening wysiwig in full screen window. So it is not possible for us to write any shortcode, unless we switch keyboard or write it elsewhere and copy to editor or remember the numeric value of the symbol and writing it on numlock.

I am not sure, and i doubt, that this can be solved via language .pot file (so that every language could define the keys for every shortcut), and i have not found, where it is defined. I know that tinymce got addShortcut method, bot no delete or edit shortcut....

it is wrong in both trunk and latest

Change History (15)

#1 follow-up: @ocean90
4 years ago

  • Summary changed from Cannot create shortcode with default Czech, Slovak and maybe other keyboards to Cannot create shortcut with default Czech, Slovak and maybe other keyboards
  • Version trunk deleted

#3 in reply to: ↑ 1 @thomask
4 years ago

Replying to ocean90:

this changed summary is wrong. It is not about not being able to create shortcut. It is about not being able to create shortcode (because of stupid shortcut that conflicts with shortcode creation).

#4 @ocean90
4 years ago

  • Summary changed from Cannot create shortcut with default Czech, Slovak and maybe other keyboards to Sqaure brackets for shortcodes can't be entered with default Czech, Slovak and maybe other keyboards

#5 in reply to: ↑ 2 @thomask
4 years ago

  • Summary changed from Sqaure brackets for shortcodes can't be entered with default Czech, Slovak and maybe other keyboards to Cannot create shortcut with default Czech, Slovak and maybe other keyboards

Replying to pavelevap:

Related: https://core.trac.wordpress.org/ticket/21976#comment:11

yes, partialy. but this is not about existence of the tinymce fullscreen but just about the conflicting keyboard shortcut for important wordpress functionality.

And it is more an universal problem, there are much more number of tinymce shortcuts and many international keyboards that use right alt click for some characters, that may have been conflicting with some core functionality. So the solution for this problem should be universal - putting shortcuts to language .pot file (the name / description of the shortcut is allready in the .pot), and/or filter on the the tinymce addshortcode definition.

and also wontfix and 3 years history of this bug is something what is not satisfying for me

Last edited 4 years ago by thomask (previous) (diff)

#6 @SergeyBiryukov
4 years ago

  • Summary changed from Cannot create shortcut with default Czech, Slovak and maybe other keyboards to Square brackets for shortcodes can't be entered with default Czech, Slovak and maybe other keyboards

#8 @azaozz
4 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to worksforme
  • Status changed from new to closed

We are using the proper modifier keys reserved for the browser. However these still can conflict with some rarely used keyboard layouts. Also, unfortunately the browsers do not distinguish between left and right modifier keys, so we cannot exclude "left alt" for example.

On the other hand, we do not use Alt + F in the editor. The shortcut is Ctrl + Alt + F (on Windows). So it seems the keyboard map doesn't work properly if it fails to interpret the Ctrl key. Maybe look for a better mapping file for your OS?

In the meantime, this shortcut is added by the TinyMCE 'fullscreen' plugin. It can be removed with something like:

jQuery( document ).on( 'tinymce-editor-init', function( event, editor ) {
  editor.shortcuts.remove( 'meta+alt+f' );
});

Closing as worksforme for now. If there are other shortcuts that match exactly the editor shortcuts, the only thing we could do is make the comments shortcuts option in the user profile global.

Last edited 4 years ago by azaozz (previous) (diff)

#9 follow-up: @thomask
4 years ago

  • Resolution worksforme deleted
  • Status changed from closed to reopened

I hate this "works for me" from north americans that cannot imagine there is a world behind the water. Please, keep in mind, that there are milions of wordpress users, that do not use english/us/canadian keyboard layouts (and english language)

No, it does not work (even with today's nightly), no it is not bug of someones keyboard mapping etc.

  1. CTRL+ALT equals RIGHT ALT (at least on windows)
  2. RIGHT ALT + some characters are used in many languages, e.g. as i have described, Right alt + F is "[" in STANDARD windows layouts for slovak republic (http://ascii-table.com/img/keyboard-245.png) - 5 milion people, czech republic (https://upload.wikimedia.org/wikipedia/commons/thumb/e/ed/Keyboard_layout_Czech.svg/420px-Keyboard_layout_Czech.svg.png) - 10 milion people, Poland (http://ascii-table.com/img/keyboard-214.png) - 39 milion people etc.

extra plugins and hacks are fine, but they will not be sollution for many (i guess most users are not able to find/install proper plugins).

I guess that there might be other isues for other ctrl+alt+something shortcuts in some languages so i believe, that it would be better to find out some more standard solution how to redefine them (imo best would be settings in POT file and option to turn them off in Options).

#10 in reply to: ↑ 9 @azaozz
4 years ago

Replying to thomask:

I hate this "works for me" from north americans...

Ugh, bad attitude won't help, especially here on trac (I'm actually from Europe, my first language is not English).

  1. CTRL+ALT equals RIGHT ALT (at least on windows)

No. Right Alt emulates AltGr on some keyboard layouts, and Ctrl+Alt may emulate AltGr too. That is for using US keyboards (hardware) with languages other than English. The fact that Right Alt is seen by the browsers as Ctrl+Alt is not proper. More info about AltGr and the history there: https://en.wikipedia.org/wiki/AltGr_key.

  1. RIGHT ALT + some characters are used in many languages...

Right, that's why most of the custom TinyMCE shortcuts that we add use Shift + Alt + letter (on Windows).

Also, as I mentioned above the Full Screen shortcut comes from the TinyMCE 'fullscreen' plugin. It has nothing to do with WordPress. You can open an issue there if it needs changing, however keep in mind that it appears to be working properly for most of the (English and non English) users.

#11 @thomask
4 years ago

sorry, i didn't mean to be harsh, it was just a sigh over my last 12 years experience with WordPress, the only popular CMS that completely ignore multilanguage/multinational website needs (i hope that at least in 2016 we will finaly get official way how to make websites in more that one language, without dirty hacks and overcomplex plugins)

I have posted the issue to tinymce github (https://github.com/tinymce/tinymce/issues/2781) and once again thank you for the code for removing the shortcut, i will publicise it within czech/slovak wordpress comunity where i am active member.

Close it again as wontfix, if there is no better way how to solve it in core.

#12 @SergeyBiryukov
4 years ago

  • Milestone set to Awaiting Review

#13 follow-up: @spocke
4 years ago

It seems hard to find a keyboard combo here that works:

ctrl+alt+f = alt gr+f = letter in some languages
cmd+shift+f = hide fullscreen toolbar in chrome on mac os x
ctrl+f = search/replace dialog

This seems to work though on all operating systems: ctrl+shift+f and Google Docs uses it to compact the toolbar. It will have to be ctrl on both mac and windows/linux since cmd+shift+f is defined above.

#14 in reply to: ↑ 13 @azaozz
4 years ago

Replying to spocke:

It seems hard to find a keyboard combo here that works:

Yeah, and it is made even worse by the Windows emulation of AltGr on some keyboard layouts. Even when using "US International", pressing the Right Alt sends Ctrl+Alt to the browsers...

I'm thinking we should probably start adding custom keyboard shortcuts only for some locales, where they are tested and proven to not conflict with any quirks in the keyboard layouts. Of course that shouldn't affect the "default" shortcuts: Ctrl+C, Ctrl+V, Ctrl+Z, etc.

I agree the custom shortcuts are very handy (for people that take the time to learn about them), but considering the "situation" with conflicting key combinations, they can be very annoying too.

What would be the best way to handle this in TinyMCE: perhaps a setting for each custom shortcut that takes the key combo string or false? Then, if not set, add a predefined key combo for some locales only? Looking at TinyMCE core, there are only 9 custom shortcuts, for the Block Format drop-down. Then few more are added by plugins.

#15 @joedolson
3 years ago

  • Focuses accessibility removed
Note: See TracTickets for help on using tickets.