Closed Bug 10515 Opened 26 years ago Closed 26 years ago

[PP] incorrect logic in keybindings with Control/Command key

Categories

(Core :: XUL, defect, P3)

defect

Tracking

()

VERIFIED FIXED

People

(Reporter: Brade, Assigned: saari)

Details

(Whiteboard: have a fix in hand)

Add the following keybinding (if it isn't already present): in mozilla/editor/ui/composer/content/EditorAppShell.xul, below </script> add: <keyset> <key id="wcmdkey" disabled="false" shift="false" command="true" alt="false" key="w" onkeypress="EditorClose()"/> </keyset> Comments from joki: To get this to work on a PC you currently have to set both in the key handler. Saari has the code ifdeffed to return true for isCommand on a PC if the control key is down but it also, of course, returns true to isControl. Since the handler is only defined for command, not command and control, the match fails. Expectation: I expect to only define the keybinding once in xul as above.
Target Milestone: M9
Status: NEW → ASSIGNED
Whiteboard: have a fix in hand
Joining cc list because I'm eagerly awaiting having keybindings work on linux.
Status: ASSIGNED → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
The logic has been changed to this: PRBool isCommand = PR_FALSE; PRBool isControl = PR_FALSE; theEvent->GetMetaKey(&isCommand); theEvent->GetCtrlKey(&isControl); if (((isCommand && (modCommand != "true")) || (!isCommand && (modCommand == "true"))) && ((isControl && (modControl != "true")) || (!isControl && (modControl == "true")))) break;
Status: RESOLVED → VERIFIED
code level fix, marking verified. reopen if i'm wrong here...
You need to log in before you can comment on or make changes to this bug.