Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
9ff9e802
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
9ff9e802
编写于
5月 21, 2017
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixes #24361: Hotkey hints are not displayed in English
上级
cf5c7cf6
变更
3
展开全部
隐藏空白更改
内联
并排
Showing
3 changed file
with
195 addition
and
126 deletion
+195
-126
src/vs/workbench/services/keybinding/common/windowsKeyboardMapper.ts
...bench/services/keybinding/common/windowsKeyboardMapper.ts
+66
-13
src/vs/workbench/services/keybinding/test/win_ru.txt
src/vs/workbench/services/keybinding/test/win_ru.txt
+109
-109
src/vs/workbench/services/keybinding/test/windowsKeyboardMapper.test.ts
...ch/services/keybinding/test/windowsKeyboardMapper.test.ts
+20
-4
未找到文件。
src/vs/workbench/services/keybinding/common/windowsKeyboardMapper.ts
浏览文件 @
9ff9e802
...
...
@@ -309,6 +309,8 @@ export class WindowsKeyboardMapper implements IKeyboardMapper {
}
}
let
producesLetter
:
boolean
[]
=
[];
this
.
_codeInfo
=
[];
for
(
let
strCode
in
rawMappings
)
{
if
(
rawMappings
.
hasOwnProperty
(
strCode
))
{
...
...
@@ -347,25 +349,76 @@ export class WindowsKeyboardMapper implements IKeyboardMapper {
withShiftAltGr
:
withShiftAltGr
,
};
this
.
_codeInfo
[
scanCode
]
=
mapping
;
this
.
_scanCodeToKeyCode
[
scanCode
]
=
keyCode
;
if
(
keyCode
===
KeyCode
.
Unknown
)
{
continue
;
}
this
.
_keyCodeExists
[
keyCode
]
=
true
;
if
(
value
.
length
===
0
)
{
// This key does not produce strings
this
.
_keyCodeToLabel
[
keyCode
]
=
null
;
}
else
if
(
value
.
length
>
1
)
{
// This key produces a letter representable with multiple UTF-16 code units.
this
.
_keyCodeToLabel
[
keyCode
]
=
value
;
}
if
(
keyCode
!==
KeyCode
.
Unknown
)
{
this
.
_keyCodeExists
[
keyCode
]
=
true
;
if
(
value
.
length
===
0
)
{
this
.
_keyCodeToLabel
[
keyCode
]
=
null
;
}
else
if
(
value
.
length
===
1
)
{
const
charCode
=
value
.
charCodeAt
(
0
);
if
(
charCode
>=
CharCode
.
a
&&
charCode
<=
CharCode
.
z
)
{
this
.
_keyCodeToLabel
[
keyCode
]
=
String
.
fromCharCode
(
CharCode
.
A
+
(
charCode
-
CharCode
.
a
));
}
else
{
this
.
_keyCodeToLabel
[
keyCode
]
=
value
;
}
}
else
{
else
{
const
charCode
=
value
.
charCodeAt
(
0
);
if
(
charCode
>=
CharCode
.
a
&&
charCode
<=
CharCode
.
z
)
{
const
upperCaseValue
=
CharCode
.
A
+
(
charCode
-
CharCode
.
a
);
producesLetter
[
upperCaseValue
]
=
true
;
this
.
_keyCodeToLabel
[
keyCode
]
=
String
.
fromCharCode
(
CharCode
.
A
+
(
charCode
-
CharCode
.
a
));
}
else
if
(
charCode
>=
CharCode
.
A
&&
charCode
<=
CharCode
.
Z
)
{
producesLetter
[
charCode
]
=
true
;
this
.
_keyCodeToLabel
[
keyCode
]
=
value
;
}
else
{
this
.
_keyCodeToLabel
[
keyCode
]
=
value
;
}
}
this
.
_scanCodeToKeyCode
[
scanCode
]
=
keyCode
;
}
}
// Handle keyboard layouts where latin characters are not produced e.g. Cyrillic
const
_registerLetterIfMissing
=
(
charCode
:
CharCode
,
keyCode
:
KeyCode
):
void
=>
{
if
(
!
producesLetter
[
charCode
])
{
this
.
_keyCodeToLabel
[
keyCode
]
=
String
.
fromCharCode
(
charCode
);
}
};
_registerLetterIfMissing
(
CharCode
.
A
,
KeyCode
.
KEY_A
);
_registerLetterIfMissing
(
CharCode
.
B
,
KeyCode
.
KEY_B
);
_registerLetterIfMissing
(
CharCode
.
C
,
KeyCode
.
KEY_C
);
_registerLetterIfMissing
(
CharCode
.
D
,
KeyCode
.
KEY_D
);
_registerLetterIfMissing
(
CharCode
.
E
,
KeyCode
.
KEY_E
);
_registerLetterIfMissing
(
CharCode
.
F
,
KeyCode
.
KEY_F
);
_registerLetterIfMissing
(
CharCode
.
G
,
KeyCode
.
KEY_G
);
_registerLetterIfMissing
(
CharCode
.
H
,
KeyCode
.
KEY_H
);
_registerLetterIfMissing
(
CharCode
.
I
,
KeyCode
.
KEY_I
);
_registerLetterIfMissing
(
CharCode
.
J
,
KeyCode
.
KEY_J
);
_registerLetterIfMissing
(
CharCode
.
K
,
KeyCode
.
KEY_K
);
_registerLetterIfMissing
(
CharCode
.
L
,
KeyCode
.
KEY_L
);
_registerLetterIfMissing
(
CharCode
.
M
,
KeyCode
.
KEY_M
);
_registerLetterIfMissing
(
CharCode
.
N
,
KeyCode
.
KEY_N
);
_registerLetterIfMissing
(
CharCode
.
O
,
KeyCode
.
KEY_O
);
_registerLetterIfMissing
(
CharCode
.
P
,
KeyCode
.
KEY_P
);
_registerLetterIfMissing
(
CharCode
.
Q
,
KeyCode
.
KEY_Q
);
_registerLetterIfMissing
(
CharCode
.
R
,
KeyCode
.
KEY_R
);
_registerLetterIfMissing
(
CharCode
.
S
,
KeyCode
.
KEY_S
);
_registerLetterIfMissing
(
CharCode
.
T
,
KeyCode
.
KEY_T
);
_registerLetterIfMissing
(
CharCode
.
U
,
KeyCode
.
KEY_U
);
_registerLetterIfMissing
(
CharCode
.
V
,
KeyCode
.
KEY_V
);
_registerLetterIfMissing
(
CharCode
.
W
,
KeyCode
.
KEY_W
);
_registerLetterIfMissing
(
CharCode
.
X
,
KeyCode
.
KEY_X
);
_registerLetterIfMissing
(
CharCode
.
Y
,
KeyCode
.
KEY_Y
);
_registerLetterIfMissing
(
CharCode
.
Z
,
KeyCode
.
KEY_Z
);
}
public
dumpDebugInfo
():
string
{
...
...
src/vs/workbench/services/keybinding/test/win_ru.txt
浏览文件 @
9ff9e802
此差异已折叠。
点击以展开。
src/vs/workbench/services/keybinding/test/windowsKeyboardMapper.test.ts
浏览文件 @
9ff9e802
...
...
@@ -482,9 +482,25 @@ suite('keyboardMapper - WINDOWS ru', () => {
test
(
'
mapping
'
,
(
done
)
=>
{
assertMapping
(
WRITE_FILE_IF_DIFFERENT
,
mapper
,
'
win_ru.txt
'
,
done
);
});
test
(
'
issue ##24361: resolveKeybinding Ctrl+K Ctrl+K
'
,
()
=>
{
_assertResolveKeybinding
(
mapper
,
KeyChord
(
KeyMod
.
CtrlCmd
|
KeyCode
.
KEY_K
,
KeyMod
.
CtrlCmd
|
KeyCode
.
KEY_K
),
[{
label
:
'
Ctrl+K Ctrl+K
'
,
ariaLabel
:
'
Control+K Control+K
'
,
electronAccelerator
:
null
,
userSettingsLabel
:
'
ctrl+k ctrl+k
'
,
isWYSIWYG
:
true
,
isChord
:
true
,
dispatchParts
:
[
'
ctrl+K
'
,
'
ctrl+K
'
],
}]
);
});
});
suite
(
'
misc
'
,
()
=>
{
suite
(
'
keyboardMapper -
misc
'
,
()
=>
{
test
(
'
issue #23513: Toggle Sidebar Visibility and Go to Line display same key mapping in Arabic keyboard
'
,
()
=>
{
const
mapper
=
new
WindowsKeyboardMapper
(
false
,
{
'
KeyB
'
:
{
...
...
@@ -507,11 +523,11 @@ suite('misc', () => {
mapper
,
KeyMod
.
CtrlCmd
|
KeyCode
.
KEY_B
,
[{
label
:
'
Ctrl+
لا
'
,
ariaLabel
:
'
Control+
لا
'
,
label
:
'
Ctrl+
B
'
,
ariaLabel
:
'
Control+
B
'
,
electronAccelerator
:
'
Ctrl+B
'
,
userSettingsLabel
:
'
ctrl+b
'
,
isWYSIWYG
:
fals
e
,
isWYSIWYG
:
tru
e
,
isChord
:
false
,
dispatchParts
:
[
'
ctrl+B
'
,
null
],
}]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录