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

Fixed #71134 #71500

Merged
merged 1 commit into from Jul 15, 2019

Conversation

@kostyabushuev
Copy link
Contributor

commented Mar 31, 2019

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

5 checks passed

VS Code Build #20190331.8 succeeded
Details
VS Code (Linux) Linux succeeded
Details
VS Code (Windows) Windows succeeded
Details
VS Code (macOS) macOS succeeded
Details
license/cla All CLA requirements met.
@joaomoreno

This comment has been minimized.

Copy link
Member

commented Jul 15, 2019

Thanks!

@kostyabushuev kostyabushuev deleted the kostyabushuev:fix-71134 branch Jul 15, 2019

@kostyabushuev kostyabushuev restored the kostyabushuev:fix-71134 branch Jul 15, 2019

@jeanp413

This comment has been minimized.

Copy link
Contributor

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

This comment has been minimized.

Copy link
Contributor Author

commented Jul 18, 2019

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

@jeanp413

This comment has been minimized.

Copy link
Contributor

commented Jul 18, 2019

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

@kostyabushuev

This comment has been minimized.

Copy link
Contributor Author

commented Jul 20, 2019

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

@jeanp413

This comment has been minimized.

Copy link
Contributor

commented Jul 21, 2019

@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

This comment has been minimized.

Copy link
Contributor

commented Jul 25, 2019

Created another PR #77911 with the proposed solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.