Skip to content

Fixed #71134#71500

Merged
joaomoreno merged 1 commit intomicrosoft:masterfrom
kostyabushuev:fix-71134
Jul 15, 2019
Merged

Fixed #71134#71500
joaomoreno merged 1 commit intomicrosoft:masterfrom
kostyabushuev:fix-71134

Conversation

@kostyabushuev
Copy link
Contributor

No description provided.

@joaomoreno joaomoreno modified the milestones: Backlog, July 2019 Jul 15, 2019
@joaomoreno joaomoreno merged commit 8dd111f into microsoft:master Jul 15, 2019
@joaomoreno
Copy link
Member

Thanks!

@kostyabushuev kostyabushuev deleted the fix-71134 branch July 15, 2019 15:34
@kostyabushuev kostyabushuev restored the fix-71134 branch July 15, 2019 15:34
@jeanp413
Copy link
Contributor

jeanp413 commented Jul 18, 2019

@kostyabushuev @joaomoreno I can still reproduce it. I think this should also be fixed here

mightProducePrintableCharacter(event: IKeyboardEvent): boolean {
if (event.ctrlKey || event.metaKey || event.altKey) {
// ignore ctrl/cmd/alt-combination but not shift-combinatios
return false;
}
const code = ScanCodeUtils.toEnum(event.code);
const keycode = IMMUTABLE_CODE_TO_KEY_CODE[code];
if (keycode !== -1) {
// https://github.com/microsoft/vscode/issues/74934
return false;
}

@kostyabushuev
Copy link
Contributor Author

kostyabushuev commented Jul 18, 2019

Hmm, interesting
I resumed to my commit, reinstall dependencies and build app.
And I dont have the bug

@jeanp413
Copy link
Contributor

Try using up-to-date master branch which already has the changes from this PR

@kostyabushuev
Copy link
Contributor Author

@jeanp413
could you help me with this bug?
I tried fix it, but can not understand how do it

@jeanp413
Copy link
Contributor

@kostyabushuev I think I fixed it with this changes. I tested it on ubuntu 18.04 and it's working. Not sure if you need to create a new PR or push the changes here and @joaomoreno could merge it again.

--- a/src/vs/workbench/services/keybinding/browser/keybindingService.ts
+++ b/src/vs/workbench/services/keybinding/browser/keybindingService.ts
@@ -46,7 +46,7 @@ import { IKeymapService } from 'vs/workbench/services/keybinding/common/keymapIn
 import { getDispatchConfig } from 'vs/workbench/services/keybinding/common/dispatchConfig';
 import { isArray } from 'vs/base/common/types';
 import { INavigatorWithKeyboard } from 'vs/workbench/services/keybinding/common/navigatorKeyboard';
-import { ScanCodeUtils, IMMUTABLE_CODE_TO_KEY_CODE } from 'vs/base/common/scanCode';
+import { ScanCode, ScanCodeUtils, IMMUTABLE_CODE_TO_KEY_CODE, IMMUTABLE_KEY_CODE_TO_CODE } from 'vs/base/common/scanCode';
 
 interface ContributedKeyBinding {
        command: string;
@@ -535,6 +535,29 @@ export class WorkbenchKeybindingService extends AbstractKeybindingService {
                        return false;
                }
                const code = ScanCodeUtils.toEnum(event.code);
+
+               const NUMPAD_PRINTABLE_SCANCODES = [
+                       ScanCode.NumpadDivide,
+                       ScanCode.NumpadMultiply,
+                       ScanCode.NumpadSubtract,
+                       ScanCode.NumpadAdd,
+                       ScanCode.Numpad1,
+                       ScanCode.Numpad2,
+                       ScanCode.Numpad3,
+                       ScanCode.Numpad4,
+                       ScanCode.Numpad5,
+                       ScanCode.Numpad6,
+                       ScanCode.Numpad7,
+                       ScanCode.Numpad8,
+                       ScanCode.Numpad9,
+                       ScanCode.Numpad0,
+                       ScanCode.NumpadDecimal
+               ];
+               const immutableScanCode = IMMUTABLE_KEY_CODE_TO_CODE[event.keyCode];
+               if (NUMPAD_PRINTABLE_SCANCODES.indexOf(code) >= 0 && code === immutableScanCode) {
+                       return true;
+               }
+
                const keycode = IMMUTABLE_CODE_TO_KEY_CODE[code];
                if (keycode !== -1) {
                        // https://github.com/microsoft/vscode/issues/74934

@jeanp413
Copy link
Contributor

Created another PR #77911 with the proposed solution

@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

list-widget List widget issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants