Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace default hotkey with Shift+Pause #1337

Merged
merged 1 commit into from
Oct 30, 2021
Merged

Replace default hotkey with Shift+Pause #1337

merged 1 commit into from
Oct 30, 2021

Conversation

isaak654
Copy link
Collaborator

@isaak654 isaak654 commented Oct 26, 2021

This is only related to Plus UI.

The Cancel reference related to the default hotkey is automatically translated on the Plus UI as it was a Cancel button for dialogs. This conflict (partially due to how Qt interpretes the key codes) would be fixed by replacing the default Ctrl+Alt+Cancel with Shift+Pause or other alternatives I proposed here.

Copy link
Collaborator

@mpheath mpheath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VK_CANCEL = 0x03 Break
VK_PAUSE  = 0x13 Pause

are the Microsoft virtual key codes.

Pause = Shift+Break

Shift key is needed for Pause on my keyboard.

Ctrl+Alt+Cancel = Ctrl+Alt+Break

might be compatible.

Cancel is probably an unusual key text, though probably correct translated virtual key code. If Break can be substituted for Cancel, then that might be better. I have not seen a Cancel key on a Querty keyboard, perhaps it is a Apple thing.

I am not sure of a literal key text for virtual key codes for Qt. @DavidXanatos may have better insight with this topic with the text return from QKeyEvent::text().

References:

List of Virtual Key Codes
Virtual-Key Codes
Qt.Key

@isaak654
Copy link
Collaborator Author

isaak654 commented Oct 26, 2021

Cancel can't surely stay as it is, because it conflicts with the italian translation of the Cancel button on the UI (which is totally another thing for another purpose). If Break is more correct than Pause, then so be it, I can apply the change right now.

@isaak654
Copy link
Collaborator Author

@NewKidOnTheBlock
In case you want to express your opinion about the Pause / Break matter.

@NewKidOnTheBlock
Copy link
Contributor

NewKidOnTheBlock commented Oct 26, 2021

Hehe. We already talked about this here: #965
"Pause" is simply the most widely used term for that key and it's the same in all languages.
German:
image
English:
image
Ciao Ragazzi:
image

@DavidXanatos
Copy link
Member

Changing the sequence string will not help, the string tells the hotkey library on which key to listen if you change it it will just not work, you can test it by pressing key combinations and see what the entry windows makes out of it

@isaak654
Copy link
Collaborator Author

Changing the sequence string will not help, the string tells the hotkey library on which key to listen if you change it it will just not work, you can test it by pressing key combinations and see what the entry windows makes out of it

If you set Italian language on Plus and then try to apply manually Ctrl+Alt+Pause on the UI box, that would be incorrectly displayed as Ctrl+Alt+Annulla.

Annulla is the italian translation of the Cancel button related to dialogs, which can assume a different meaning on my language.

This is why Cancel cannot be associated to a Pause/Break button or at least not translated as the Cancel button on the UI dialogs.

@DavidXanatos
Copy link
Member

You can play around with what Qt thinks of different key combinations by clicking in the QKeySequenceEdit that takes the combination and pressing various keys and key combinations.

break: Pause
ctrl+alt+break: Ctrl+Alt+Cancel
alt+break: Alt+Pause
shift+break: Shift+Pause
AltGr+break: Ctrl+Alt+Pause
ctrl+break: is not taken but can be set in the ini as Ctrl+Cancel
ctrl+num_lock: Ctrl+Pause

there is soemthign somehow screwed up in how Qt interpretes the key codes, and I don't think its a good use of my time to fork the QKeySequenceEdit

@isaak654
Copy link
Collaborator Author

isaak654 commented Oct 27, 2021

break: Pause
ctrl+alt+break: Ctrl+Alt+Cancel
alt+break: Alt+Pause
shift+break: Shift+Pause
AltGr+break: Ctrl+Alt+Pause
ctrl+break: is not taken but can be set in the ini as Ctrl+Cancel
ctrl+num_lock: Ctrl+Pause

there is soemthign somehow screwed up in how Qt interpretes the key codes

It looks like you're right, Qt really screwed up certain combination keys. I've just tested PanicKeySequence=Ctrl+Alt+Pause inside the Sandboxie-Plus.ini and basically it means that AltGr+Break is necessary to activate the hotkey, but you can't do the opposite. This is so confusing on the user side.

At this point, I would propose to choose Shift+Pause as default for the Sandboxie-Plus.ini file.

Other working alternatives that I tested: Shift+P, Alt+Pause, Shift+T... any comment would be appreciated.

@isaak654 isaak654 changed the title Default hotkey fix Replace default hotkey with Shift+Pause Oct 30, 2021
@DavidXanatos
Copy link
Member

Well I personally prefer ctrl + break, but its a problematic combination you cant even re enter it properly, strangely enough ctrl+scrol lock enters ctrl+cancel... so given that its so widely inconsistent i think shift + break is a good alternative indeed. So lets do that :)

@DavidXanatos DavidXanatos merged commit c2a42b7 into master Oct 30, 2021
@isaak654 isaak654 deleted the patch-1 branch October 30, 2021 14:49
@offhub offhub added the Feature: Hotkeys Hotkey related issues label Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature: Hotkeys Hotkey related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants