Make WordPress Core

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#29558 closed defect (bug) (fixed)

Alt+Shift shortcuts override character input

Reported by: balkana's profile Balkana Owned by: azaozz's profile azaozz
Milestone: 4.2 Priority: normal
Severity: major Version: 2.5
Component: TinyMCE Keywords: has-patch
Focuses: Cc:

Description

I am using default wordpress editor for posts and I run into a issue when I want to write this char: " [ ".
I am from Croatia, and key combination for this is Alt Gr + F When I press that the editor goes full screen, what is really weird and I can't find a solution (I am forced to copy/paste that char from somewhere else).

Attachments (9)

29558.patch (4.3 KB) - added by iseulde 10 years ago.
29558.2.patch (2.3 KB) - added by iseulde 10 years ago.
29558.3.patch (7.6 KB) - added by iseulde 10 years ago.
29558.4.patch (7.6 KB) - added by iseulde 10 years ago.
29558.5.patch (9.7 KB) - added by iseulde 10 years ago.
29558.6.patch (14.7 KB) - added by iseulde 10 years ago.
29558.7.patch (4.7 KB) - added by azaozz 10 years ago.
help.png (28.8 KB) - added by azaozz 10 years ago.
help-patched.png (46.9 KB) - added by azaozz 10 years ago.

Download all attachments as: .zip

Change History (38)

#1 @azaozz
10 years ago

As far as I see there is no easy solution to this. Only way would be to remove the Alt + Shift + F shortcut. I'm open to any other suggestions :)

#2 @iseulde
10 years ago

  • Keywords needs-patch added
  • Severity changed from normal to major
  • Version changed from 3.9.2 to 2.5

This is actually a really annoying problem. I've never noticed this before, but I also have problems when I try to add characters in TinyMCE with Alt+Shift. A lot of those combinations are overwritten by WordPress, such as Alt+Shift+D = ∆ and Alt+Shift+L = | (AZERTY) which I use quite a lot outside WordPress.

All these characters are blocked for an AZERTY keyboard:

ı Í ∆ ª Œ Ω › ∏ ⁄ | ¢ ‚ Æ ∑ Ó ™ Î Å

And these for QWERTY:

ˆ Ô Î Ë Ø Å Û ∏ Ù Ò Ç Â Œ Í Ú Ê Ó „

Of course that doesn't really matter. It's different for other keyboards and the user should be able to add these characters just like everywhere else.

These shortcuts are added by WordPress, not TinyMCE.

Since [7147].

#3 @iseulde
10 years ago

  • Milestone changed from Awaiting Review to 4.2
  • Summary changed from Key conflict in editor while using Croatian keyboard to Alt+Shift shortcuts override character input

Let's do something about this. Alt+Shift should be replaced with something else as it is used for character input.

#4 @azaozz
10 years ago

Don't think we can change the modifier keys. Every modifier combination is already in use. The Alt+Shift+letter was chosen as it is "reserved" in most browsers to trigger the accesskey attribute for buttons.

Seems the only thing we can do is have an "Enable/Disable custom shortcuts" global option replacing the current one which is only for moderating comments (think there was an old ticket for that). Or maybe it can be per screen.

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

#5 @iseulde
10 years ago

On a mac + Chrome, you need to use ctrl+alt for the accesskey attribute. shift+alt is reserved for characters.
This is the best I could find for now: https://en.wikipedia.org/wiki/Access_key

This will be fun to figure out. :)

#6 @iseulde
10 years ago

Looks like all major browsers on a mac now use ctrl+alt for accesskey. On window it's always either alt or shift+alt. So I assume alt and shift+alt are not used for characters on Windows? And if they do, which has precedence when the focus is an input field? Maybe we can switch to ctrl+alt for a mac?

#7 @iseulde
10 years ago

Blocked because of this: https://github.com/tinymce/tinymce/blob/master/js/tinymce/classes/Shortcuts.js#L32
Asked spocke for suggestions. Alternatively we could use cmd+alt, but would be better to use the same as accesskey.

#8 @helen
10 years ago

We could probably get rid of the original one for link, since it's also now cmd-K. Will be a little annoying for people to relearn, I suppose.

#9 @iseulde
10 years ago

Yes, but they all need to change. :/

#10 @helen
10 years ago

#31035 was marked as a duplicate.

#11 @drozdz
10 years ago

On windows there are 2 Alt keys and they work in different ways. Left Alt is used for shortcuts and right one (also with Shift modifier) is used for inserting special characters.

Version 0, edited 10 years ago by drozdz (next)

#12 @azaozz
10 years ago

This was added in TinyMCE: https://github.com/tinymce/tinymce/commit/7de8b6ce3578b063154148c840642d9fd8e7c503. If we are going to change the custom shortcuts on Mac, lets do it now/early (we can update to the latest dev. version of MCE).

@drozdz, unfortunately the browsers cannot detect which Ctrl/Alt/Shift key is pressed, left or right.

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

#13 follow-up: @iseulde
10 years ago

Oh, that's great! :) But we'll need to wait for a release, right?

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

Replying to iseulde:

Well, I suppose we can update to the latest build of TinyMCE for now. There will probably be a new release before 4.2, will update again when it comes out.

@iseulde
10 years ago

#15 @samuelsidler
10 years ago

  • Priority changed from normal to low

@iseulde
10 years ago

#16 @afercia
10 years ago

About Alt or AltGr on Windows, TinyMCE says the latter produces also ctrlKey, not sure this can help though:

metaKeyPressed: function(e) {
	// Check if ctrl or meta key is pressed. Edge case for AltGr on Windows where it produces ctrlKey+altKey states
	return (Env.mac ? e.metaKey : e.ctrlKey && !e.altKey);
}

This ticket was mentioned in Slack in #core by drew. View the logs.


10 years ago

#18 @afercia
10 years ago

My bad, please ignore my comment, didn't see the TinyMCE "access" thing. :)

#19 @azaozz
10 years ago

Thinking this will never be fully fixed until we let the users disable these shortcuts. There are just too many key combinations used in far too many contexts. We should let the users decide what they prefer.

I know this is not "Decisions, not options!" but that option already exists on the Profile screen:

Keyboard Shortcuts	 Enable keyboard shortcuts for comment moderation. More information

We should be using that globally. Lets do that in 4.3, finally :)

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

@iseulde
10 years ago

@iseulde
10 years ago

#20 @iseulde
10 years ago

  • Keywords has-patch added; needs-patch removed

Patch dynamically generates the keyboard shortcut modal.
Also redefines the heading shortcuts. (#30422)
To do: scroll bar needs to be positioned better.

#21 @iseulde
10 years ago

Another to do: move the whole thing out of the addCommand callback. :)

This ticket was mentioned in Slack in #core by drew. View the logs.


10 years ago

@iseulde
10 years ago

@iseulde
10 years ago

#23 @DrewAPicture
10 years ago

29558.6.patch fixes the heading shortcuts for me in FF, Chrome, and Safari. I think the new modal contents are an improvement in terms of helpful information. We're still limited by the fact that TinyMCE modals aren't responsive.

#24 @DrewAPicture
10 years ago

  • Priority changed from low to high

This ticket was mentioned in Slack in #core-editor by azaozz. View the logs.


10 years ago

@azaozz
10 years ago

@azaozz
10 years ago

@azaozz
10 years ago

#26 @azaozz
10 years ago

29558.7.patch fixes the shortcodes on Mac.

However redoing of the modal needs more. Not so happy with removal of all the text from it. Also needs CSS fixes that are not trivial as the styles interfere with the TinyMCE UI building. Perhaps can consider moving away from tables too.

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

#27 @azaozz
10 years ago

In 32059:

TinyMCE: fix our shortcuts on Mac, use Ctrl + Opt + letter.
Props iseulde. See #29558.

#28 @azaozz
10 years ago

  • Owner set to azaozz
  • Resolution set to fixed
  • Status changed from new to closed

In 32060:

TinyMCE: update the "Keyboard Shortcuts" modal.
Fixes #29558.

#29 @DrewAPicture
10 years ago

  • Priority changed from high to normal
Note: See TracTickets for help on using tickets.