tdesktop icon indicating copy to clipboard operation
tdesktop copied to clipboard

GUI: Ctrl+Shift+ hotkeys not working with non-English keymap

Open v0s opened this issue 7 years ago • 27 comments

screen3

Steps to reproduce

  1. Type some text in the chat box.
  2. When EN keymap is active:
  • press Ctrl+Z — the text is undone;
  • press Ctrl+Shift+Z — the text is redone.
  1. Switch to RU keymap:
  • press Ctrl+Z — text is undone, works ok;
  • press Ctrl+Shift+Z — instead of a redo, capital Z gets entered (even despite keymap being RU).

Same applies to Ctrl+Shift+M hotkey for monospace formatting.

Expected behaviour

Even with RU keymap, Ctrl+Shift+Z should redo, and Ctrl+Shift+M should make text monospace.

Actual behaviour

With RU keymap, Ctrl+Shift+ hotkeys do not do the actions, instead they type corresponding capital English letter.

Configuration

Operating system: Windows 10 1709 Version of Telegram Desktop: 1.3.10 Used theme: default

v0s avatar Jul 13 '18 22:07 v0s

Hey there!

This issue will be automatically closed in 7 days if there would be no activity. We therefore assume that the user has lost interest or resolved the problem on their own.

Don't worry though; if this is an error, let us know with a comment and we'll be happy to reopen the issue.

Thanks!

stale[bot] avatar Oct 24 '20 08:10 stale[bot]

Still there, still annoying

v0s avatar Oct 24 '20 08:10 v0s

Hey there!

This issue was inactive for a long time and will be automatically closed in 30 days if there isn't any further activity. We therefore assume that the user has lost interest or resolved the problem on their own.

Don't worry though; if this is an error, let us know with a comment and we'll be happy to reopen the issue.

Thanks!

stale[bot] avatar May 01 '21 06:05 stale[bot]

Still there, still annoying.

The behavior changed a bit: now when pressing Ctrl+Shift+Z with RU keymap active, nothing happens (previously uppercase latin Z was typed). Less destructive since it doesn't overwrite undo/redo history, but still hotkey doesn't work as intended

v0s avatar May 01 '21 13:05 v0s

Same applies to Ctrl+Shift+M hotkey for monospace formatting.

Maybe the "shortcuts-default.json" and "shortcuts-custom.json" could be parsed & mapped internally according to the "key position of M" in the EN layout, and not "M character key" itself?

Also, I can't find the commands for changing the formatting shortcuts in "shortcuts-custom.json". I checked here.

ghost avatar Jun 13 '21 02:06 ghost

I'm mostly working on Linux code, but since no one looks into this and there's someone who doesn't allow stale-bot to close the issue, I tried to reproduce it and... I can't.

https://user-images.githubusercontent.com/17829319/135739183-dd24db01-186b-4a0f-9295-0c66ef07f188.mp4

This is a VM with Russian Windows 10 1809

ilya-fedin avatar Oct 03 '21 04:10 ilya-fedin

Windows 10 1803, I have that issue on the latest Telegram Beta v3.5.1 (04.02.22).

Function Hot Key English Layout Russian Layout
Bold CTRL+B
Italic CTRL+I
Underline CTRL+U
Strikethrough CTRL+SHIFT+X
Monospaced CTRL+SHIFT+M
Hidden/Private CTRL+SHIFT+P
Add URL Link CTRL+K
Remove formatting CTRL+SHIFT+N

So all CTRL+SHIFT shortcuts is not working for me.

grandsilence avatar Feb 16 '22 13:02 grandsilence

@grandsilence maybe it is a good reason to update to 1809?

ilya-fedin avatar Feb 16 '22 21:02 ilya-fedin

@ilya-fedin unfortunately 1803 is the last Windows version with low latency. It's a lot faster on old hardware. 1809 has 10MHz timer, absolutely no reasons to use 1809, 21h1 faster but slower than 1803.

grandsilence avatar Feb 16 '22 21:02 grandsilence

@grandsilence maybe it is a good reason to update to 1809?

I don't think it's relevant, i'm on 21H2 and Ctrl-Shift hotkeys are not working with Russian layout on the latest Telegram Desktop

v0s avatar Feb 16 '22 23:02 v0s

@v0s what's relevant then? I can't reproduce the problem, Ctrl+Shift hotkeys work just fine on my machine with Russian layout

ilya-fedin avatar Feb 16 '22 23:02 ilya-fedin

@ilya-fedin How can I help in reproducing? I can think of making you a Windows VM in which the hotkeys don't work :-)

v0s avatar Feb 16 '22 23:02 v0s

@ilya-fedin I can make test environments on 1803, 1909, 2004, 21h1, 21h2 and provide VirtualBox image. Let me know if you need it.

grandsilence avatar Feb 16 '22 23:02 grandsilence

@v0s yeah, such a VM would be great. I have VirtualBox and libvirt. Although, I would need to make free space somehow apparently 😅

ilya-fedin avatar Feb 16 '22 23:02 ilya-fedin

@ilya-fedin what's the best way to provide a functional instance without giving you access to my Telegram account? :-) E.g. is there a way to maybe register an account on test server, not tied to a phone number? 🤔

v0s avatar Feb 16 '22 23:02 v0s

@ilya-fedin About 8Gb will be enough actually. 1803 is a tiny OS (especially without Metro Apps).

grandsilence avatar Feb 16 '22 23:02 grandsilence

@v0s I have an empty account and I can give access to it. Or just use any SMS activation service.

grandsilence avatar Feb 16 '22 23:02 grandsilence

@grandsilence yes please! you can pm me at t.me/mrvos

v0s avatar Feb 16 '22 23:02 v0s

@v0s you can remove %APPDATA%\Telegram Desktop after ensuring the bug is reproducible

ilya-fedin avatar Feb 16 '22 23:02 ilya-fedin

I will download a new copy of tdesktop anyway most likely. So you can test with a portable copy and then remove it.

ilya-fedin avatar Feb 16 '22 23:02 ilya-fedin

@ilya-fedin I can make test environments on 1803, 1909, 2004, 21h1, 21h2 and provide VirtualBox image. Let me know if you need it.

well, i don't think we need to care about windows under 1909 (all of them unsuported) (and on 3 months under 20h2)

Aokromes avatar Feb 17 '22 00:02 Aokromes

@ilya-fedin @Aokromes so, i've dug a little further, and got the following:

  1. On the default Russian layout, Ctrl+Shift+ hotkeys actually do work. Sorry for confusion
  2. I use the Typography layout (https://ilyabirman.ru/typography-layout/) that allows typing symbols like ±—↑↓ easily, and the hotkey work on its English variant, but do not work on Russian
  3. I have also found a standard layout that also breaks Ctrl+Shift+ hotkeys: "Ukrainian (Enhanced)" / Украинская (Расширенная)
  4. At the same time, regular Ukrainian layout does have them working, despite having AltGr hotkeys like the Typography one.

So, it looks like the reason is somewhere deeper, here is the VirtualBox VM with Windows 21H2 (most default settings) and Telegram Desktop with Typography layout and @grandsilence's account (thanks!). https://big.vos.uz/win10vm.7z (3.7 GB)

apt -y install aria2; aria2c -x5 https://big.vos.uz/win10vm.7z for fast multi-threaded download

Will you be able to take a look and trace it down?

v0s avatar Feb 17 '22 00:02 v0s

I can reproduce with Ukrainian (Enhanced) even with my Windows. This seem to be a Qt bug as it's Qt who handles the keyboard :(

ilya-fedin avatar Feb 17 '22 00:02 ilya-fedin

@ilya-fedin got it, can you maybe specify a little bit what exactly seems to be the bug in Qt? So that it can be reported to them instead

v0s avatar Feb 17 '22 12:02 v0s

can you maybe specify a little bit what exactly seems to be the bug in Qt?

This is handled with such a check in a QTextEdit::keyPressEvent override:

	const auto matches = [&](const QKeySequence &sequence) {
		const auto searchKey = (e->modifiers() | e->key())
			& ~(Qt::KeypadModifier | Qt::GroupSwitchModifier);
		const auto events = QKeySequence(searchKey);
		return sequence.matches(events) == QKeySequence::ExactMatch;
	};
	if (matches(QKeySequence("ctrl+shift+m")) {
		...
	}

And it doesn't work with these layouts for some reason

ilya-fedin avatar Feb 17 '22 13:02 ilya-fedin

Hey there!

This issue was inactive for a long time and will be automatically closed in 30 days if there isn't any further activity. We therefore assume that the user has lost interest or resolved the problem on their own.

Don't worry though; if this is an error, let us know with a comment and we'll be happy to reopen the issue.

Thanks!

github-actions[bot] avatar Sep 05 '22 02:09 github-actions[bot]

Still there, still annoying

v0s avatar Sep 05 '22 09:09 v0s

This issue is now a part of #25126

ilya-fedin avatar Sep 24 '22 13:09 ilya-fedin

Hey there!

This issue was inactive for a long time and will be automatically closed in 30 days if there isn't any further activity. We therefore assume that the user has lost interest or resolved the problem on their own.

Don't worry though; if this is an error, let us know with a comment and we'll be happy to reopen the issue.

Thanks!

github-actions[bot] avatar Mar 24 '23 01:03 github-actions[bot]

Still there, still annoying

v0s avatar Mar 24 '23 07:03 v0s