mirror of
https://github.com/VSCodeVim/Vim.git
synced 2024-11-11 06:39:50 +03:00
Add Swedish keyboard layout
This commit is contained in:
parent
6ae24ac68e
commit
521a09c8b2
@ -97,6 +97,9 @@ export function activate(context: vscode.ExtensionContext) {
|
||||
|
||||
registerCommand(context, 'extension.vim_backslash', () => handleKeyEvent("\\"));
|
||||
|
||||
registerCommand(context, 'extension.vim_oem_102', () => handleKeyEvent("oem_102"));
|
||||
registerCommand(context, 'extension.vim_shift_oem_102', () => handleKeyEvent("shift+oem_102"));
|
||||
|
||||
context.subscriptions.push(modeHandler);
|
||||
}
|
||||
|
||||
|
@ -117,7 +117,9 @@
|
||||
{ "key": "Ctrl+r", "command": "extension.vim_ctrl_r", "when": "editorTextFocus" },
|
||||
|
||||
{ "key": "Shift+,", "command": "extension.vim_<", "when": "editorTextFocus" },
|
||||
{ "key": "Shift+.", "command": "extension.vim_>", "when": "editorTextFocus" }
|
||||
{ "key": "Shift+.", "command": "extension.vim_>", "when": "editorTextFocus" },
|
||||
{ "key": "oem_102", "command": "extension.vim_oem_102", "when": "editorTextFocus" },
|
||||
{ "key": "Shift+oem_102", "command": "extension.vim_shift_oem_102", "when": "editorTextFocus" }
|
||||
],
|
||||
"configuration": {
|
||||
"title": "Vim Configuration",
|
||||
|
@ -27,6 +27,8 @@ export class KeyboardLayout {
|
||||
return new KeyboardLayout(new KeyMapperDeDeQwertz());
|
||||
case 'da-DK (QWERTY)':
|
||||
return new KeyboardLayout(new KeyMapperDaDKQwerty());
|
||||
case 'sv-SE (QWERTY)':
|
||||
return new KeyboardLayout(new KeyMapperSvSEQwerty());
|
||||
default:
|
||||
return new KeyboardLayout();
|
||||
}
|
||||
@ -105,3 +107,27 @@ class KeyMapperDaDKQwerty implements KeyMapper {
|
||||
return this.mappings[key] || key;
|
||||
}
|
||||
}
|
||||
|
||||
class KeyMapperSvSEQwerty implements KeyMapper {
|
||||
|
||||
private mappings = {};
|
||||
|
||||
constructor() {
|
||||
this.mappings = {
|
||||
'oem_102': '<', // Only works when building from source atm, should work next vscode update
|
||||
'shift+oem_102': '>', // Only works when building from source atm, should work next vscode update
|
||||
'>': ':',
|
||||
'<': ';',
|
||||
':': '^',
|
||||
'^': '&'
|
||||
};
|
||||
}
|
||||
|
||||
get name() : string {
|
||||
return 'sv-SE (QWERTY)';
|
||||
}
|
||||
|
||||
get(key : string) : string {
|
||||
return this.mappings[key] || key;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user