@vscodium/native-keymap 3.3.7-258412

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/.nvmrc +1 -0
  2. package/.release-it.yml +8 -0
  3. package/LICENSE +22 -0
  4. package/README.md +82 -0
  5. package/ThirdPartyNotices.txt +42 -0
  6. package/binding.gyp +92 -0
  7. package/collected-artifacts/native-keymap-darwin-arm64/native-keymap-3.3.7-258412-darwin-arm64.tar.gz +0 -0
  8. package/collected-artifacts/native-keymap-darwin-arm64/native-keymap-3.3.7-258412-darwin-arm64.tar.gz.sha256 +1 -0
  9. package/collected-artifacts/native-keymap-darwin-x64/native-keymap-3.3.7-258412-darwin-x64.tar.gz +0 -0
  10. package/collected-artifacts/native-keymap-darwin-x64/native-keymap-3.3.7-258412-darwin-x64.tar.gz.sha256 +1 -0
  11. package/collected-artifacts/native-keymap-linux-arm64/native-keymap-3.3.7-258412-linux-arm64.tar.gz +0 -0
  12. package/collected-artifacts/native-keymap-linux-arm64/native-keymap-3.3.7-258412-linux-arm64.tar.gz.sha256 +1 -0
  13. package/collected-artifacts/native-keymap-linux-armhf/native-keymap-3.3.7-258412-linux-armhf.tar.gz +0 -0
  14. package/collected-artifacts/native-keymap-linux-armhf/native-keymap-3.3.7-258412-linux-armhf.tar.gz.sha256 +1 -0
  15. package/collected-artifacts/native-keymap-linux-loong64/native-keymap-3.3.7-258412-linux-loong64.tar.gz +0 -0
  16. package/collected-artifacts/native-keymap-linux-loong64/native-keymap-3.3.7-258412-linux-loong64.tar.gz.sha256 +1 -0
  17. package/collected-artifacts/native-keymap-linux-ppc64le/native-keymap-3.3.7-258412-linux-ppc64le.tar.gz +0 -0
  18. package/collected-artifacts/native-keymap-linux-ppc64le/native-keymap-3.3.7-258412-linux-ppc64le.tar.gz.sha256 +1 -0
  19. package/collected-artifacts/native-keymap-linux-riscv64/native-keymap-3.3.7-258412-linux-riscv64.tar.gz +0 -0
  20. package/collected-artifacts/native-keymap-linux-riscv64/native-keymap-3.3.7-258412-linux-riscv64.tar.gz.sha256 +1 -0
  21. package/collected-artifacts/native-keymap-linux-s390x/native-keymap-3.3.7-258412-linux-s390x.tar.gz +0 -0
  22. package/collected-artifacts/native-keymap-linux-s390x/native-keymap-3.3.7-258412-linux-s390x.tar.gz.sha256 +1 -0
  23. package/collected-artifacts/native-keymap-linux-x64/native-keymap-3.3.7-258412-linux-x64.tar.gz +0 -0
  24. package/collected-artifacts/native-keymap-linux-x64/native-keymap-3.3.7-258412-linux-x64.tar.gz.sha256 +1 -0
  25. package/collected-artifacts/native-keymap-win32-arm64/native-keymap-3.3.7-258412-win32-arm64.tar.gz +0 -0
  26. package/collected-artifacts/native-keymap-win32-arm64/native-keymap-3.3.7-258412-win32-arm64.tar.gz.sha256 +1 -0
  27. package/collected-artifacts/native-keymap-win32-x64/native-keymap-3.3.7-258412-win32-x64.tar.gz +0 -0
  28. package/collected-artifacts/native-keymap-win32-x64/native-keymap-3.3.7-258412-win32-x64.tar.gz.sha256 +1 -0
  29. package/deps/chromium/dom_code_data.inc +618 -0
  30. package/deps/chromium/keyboard_codes.h +23 -0
  31. package/deps/chromium/macros.h +32 -0
  32. package/deps/chromium/x/keysym_to_unicode.cc +896 -0
  33. package/deps/chromium/x/keysym_to_unicode.h +26 -0
  34. package/index.d.ts +70 -0
  35. package/index.js +70 -0
  36. package/package.json +25 -0
  37. package/release/native-keymap-3.3.7-258412-darwin-arm64.tar.gz +0 -0
  38. package/release/native-keymap-3.3.7-258412-darwin-arm64.tar.gz.sha256 +1 -0
  39. package/release/native-keymap-3.3.7-258412-darwin-x64.tar.gz +0 -0
  40. package/release/native-keymap-3.3.7-258412-darwin-x64.tar.gz.sha256 +1 -0
  41. package/release/native-keymap-3.3.7-258412-linux-arm64.tar.gz +0 -0
  42. package/release/native-keymap-3.3.7-258412-linux-arm64.tar.gz.sha256 +1 -0
  43. package/release/native-keymap-3.3.7-258412-linux-armhf.tar.gz +0 -0
  44. package/release/native-keymap-3.3.7-258412-linux-armhf.tar.gz.sha256 +1 -0
  45. package/release/native-keymap-3.3.7-258412-linux-loong64.tar.gz +0 -0
  46. package/release/native-keymap-3.3.7-258412-linux-loong64.tar.gz.sha256 +1 -0
  47. package/release/native-keymap-3.3.7-258412-linux-ppc64le.tar.gz +0 -0
  48. package/release/native-keymap-3.3.7-258412-linux-ppc64le.tar.gz.sha256 +1 -0
  49. package/release/native-keymap-3.3.7-258412-linux-riscv64.tar.gz +0 -0
  50. package/release/native-keymap-3.3.7-258412-linux-riscv64.tar.gz.sha256 +1 -0
  51. package/release/native-keymap-3.3.7-258412-linux-s390x.tar.gz +0 -0
  52. package/release/native-keymap-3.3.7-258412-linux-s390x.tar.gz.sha256 +1 -0
  53. package/release/native-keymap-3.3.7-258412-linux-x64.tar.gz +0 -0
  54. package/release/native-keymap-3.3.7-258412-linux-x64.tar.gz.sha256 +1 -0
  55. package/release/native-keymap-3.3.7-258412-win32-arm64.tar.gz +0 -0
  56. package/release/native-keymap-3.3.7-258412-win32-arm64.tar.gz.sha256 +1 -0
  57. package/release/native-keymap-3.3.7-258412-win32-x64.tar.gz +0 -0
  58. package/release/native-keymap-3.3.7-258412-win32-x64.tar.gz.sha256 +1 -0
  59. package/src/common.h +92 -0
  60. package/src/keyboard_mac.mm +209 -0
  61. package/src/keyboard_win.cc +476 -0
  62. package/src/keyboard_x.cc +407 -0
  63. package/src/keymapping.cc +147 -0
  64. package/src/keymapping.h +65 -0
  65. package/src/string_conversion.cc +67 -0
  66. package/src/string_conversion.h +18 -0
package/.nvmrc ADDED
@@ -0,0 +1 @@
1
+ v22.20.0
@@ -0,0 +1,8 @@
1
+ git:
2
+ commitMessage: v${version}
3
+ tagName: v${version}
4
+ tagAnnotation: Release version ${version}
5
+ requireCleanWorkingDir: false
6
+ npm:
7
+ publish: false
8
+ disable-metrics: true
package/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025-present The VSCodium contributors
4
+ Copyright (c) 2022-present Microsoft Corporation.
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE
package/README.md ADDED
@@ -0,0 +1,82 @@
1
+ # OS key mapping node module
2
+ Returns what characters are produced by pressing keys with different modifiers on the current system keyboard layout.
3
+
4
+ ## Installing
5
+
6
+ * On Debian-based Linux: `sudo apt-get install libx11-dev libxkbfile-dev`
7
+ * On Red Hat-based Linux: `sudo yum install libx11-devel.x86_64 libxkbfile-devel.x86_64 # or .i686`
8
+ * On SUSE-based Linux: `sudo zypper install libX11-devel libxkbfile-devel`
9
+ * On FreeBSD: `sudo pkg install libX11 libxkbfile`
10
+
11
+ ```sh
12
+ npm install @vscodium/native-keymap
13
+ ```
14
+
15
+ ## Using
16
+
17
+ ```javascript
18
+ var keymap = require('@vscodium/native-keymap');
19
+ console.log(keymap.getKeyMap());
20
+ ```
21
+
22
+ Example output when using standard US keyboard layout (on Windows):
23
+ ```
24
+ [
25
+ ...
26
+ Space: { vkey: 'VK_SPACE', value: ' ', withShift: ' ', withAltGr: '', withShiftAltGr: '' },
27
+ Minus: { vkey: 'VK_OEM_MINUS', value: '-', withShift: '_', withAltGr: '', withShiftAltGr: '' },
28
+ Equal: { vkey: 'VK_OEM_PLUS', value: '=', withShift: '+', withAltGr: '', withShiftAltGr: '' },
29
+ BracketLeft: { vkey: 'VK_OEM_4', value: '[', withShift: '{', withAltGr: '', withShiftAltGr: '' },
30
+ BracketRight: { vkey: 'VK_OEM_6', value: ']', withShift: '}', withAltGr: '', withShiftAltGr: '' },
31
+ Backslash: { vkey: 'VK_OEM_5', value: '\\', withShift: '|', withAltGr: '', withShiftAltGr: '' },
32
+ Semicolon: { vkey: 'VK_OEM_1', value: ';', withShift: ':', withAltGr: '', withShiftAltGr: '' },
33
+ Quote: { vkey: 'VK_OEM_7', value: '\'', withShift: '"', withAltGr: '', withShiftAltGr: '' },
34
+ Backquote: { vkey: 'VK_OEM_3', value: '`', withShift: '~', withAltGr: '', withShiftAltGr: '' },
35
+ Comma: { vkey: 'VK_OEM_COMMA', value: ',', withShift: '<', withAltGr: '', withShiftAltGr: '' },
36
+ Period: { vkey: 'VK_OEM_PERIOD', value: '.', withShift: '>', withAltGr: '', withShiftAltGr: '' },
37
+ Slash: { vkey: 'VK_OEM_2', value: '/', withShift: '?', withAltGr: '', withShiftAltGr: '' },
38
+ ...
39
+ ]
40
+ ```
41
+
42
+ Example output when using German (Swiss) keyboard layout (on Windows):
43
+ ```
44
+ [
45
+ ...
46
+ Space: { vkey: 'VK_SPACE', value: ' ', withShift: ' ', withAltGr: '', withShiftAltGr: '' },
47
+ Minus: { vkey: 'VK_OEM_4', value: '\'', withShift: '?', withAltGr: '´', withShiftAltGr: '' },
48
+ Equal: { vkey: 'VK_OEM_6', value: '^', withShift: '`', withAltGr: '~', withShiftAltGr: '' },
49
+ BracketLeft: { vkey: 'VK_OEM_1', value: 'ü', withShift: 'è', withAltGr: '[', withShiftAltGr: '' },
50
+ BracketRight: { vkey: 'VK_OEM_3', value: '¨', withShift: '!', withAltGr: ']', withShiftAltGr: '' },
51
+ Backslash: { vkey: 'VK_OEM_8', value: '$', withShift: '£', withAltGr: '}', withShiftAltGr: '' },
52
+ Semicolon: { vkey: 'VK_OEM_7', value: 'ö', withShift: 'é', withAltGr: '', withShiftAltGr: '' },
53
+ Quote: { vkey: 'VK_OEM_5', value: 'ä', withShift: 'à', withAltGr: '{', withShiftAltGr: '' },
54
+ Backquote: { vkey: 'VK_OEM_2', value: '§', withShift: '°', withAltGr: '', withShiftAltGr: '' },
55
+ Comma: { vkey: 'VK_OEM_COMMA', value: ',', withShift: ';', withAltGr: '', withShiftAltGr: '' },
56
+ Period: { vkey: 'VK_OEM_PERIOD', value: '.', withShift: ':', withAltGr: '', withShiftAltGr: '' },
57
+ Slash: { vkey: 'VK_OEM_MINUS', value: '-', withShift: '_', withAltGr: '', withShiftAltGr: '' },
58
+ ...
59
+ ]
60
+ ```
61
+
62
+ ## Supported OSes
63
+
64
+ - linux (X11)
65
+ - windows
66
+ - mac
67
+ - freebsd
68
+
69
+ ## Known issues
70
+
71
+ - only tested from the Electron Main process
72
+
73
+ ## Developing
74
+
75
+ - `npm install -g node-gyp`
76
+ - `node-gyp configure` (for debugging use `node-gyp configure -d`)
77
+ - `node-gyp build`
78
+ - `npm test` (for debugging change `index.js` to load the node module from the `Debug` folder and press `F5`)
79
+
80
+ ## License
81
+
82
+ [MIT](https://github.com/VSCodium/native-keymap/blob/master/LICENSE)
@@ -0,0 +1,42 @@
1
+ THIRD-PARTY SOFTWARE NOTICES AND INFORMATION
2
+ Do Not Translate or Localize
3
+
4
+ This project incorporates material from the project(s) listed below (collectively, “Third Party Code”).
5
+ Microsoft is not the original author of the Third Party Code. The original copyright notice and license
6
+ under which Microsoft received such Third Party Code are set out below. This Third Party Code is licensed
7
+ to you under their original license terms set forth below. Microsoft reserves all other rights not
8
+ expressly granted, whether by implication, estoppel or otherwise.
9
+
10
+ The following files/folders contain third party software:
11
+
12
+ =========================================================================================================
13
+ deps/chromium/**
14
+ ---------------------------------------------------------------------------------------------------------
15
+ // Copyright 2015 The Chromium Authors. All rights reserved.
16
+ //
17
+ // Redistribution and use in source and binary forms, with or without
18
+ // modification, are permitted provided that the following conditions are
19
+ // met:
20
+ //
21
+ // * Redistributions of source code must retain the above copyright
22
+ // notice, this list of conditions and the following disclaimer.
23
+ // * Redistributions in binary form must reproduce the above
24
+ // copyright notice, this list of conditions and the following disclaimer
25
+ // in the documentation and/or other materials provided with the
26
+ // distribution.
27
+ // * Neither the name of Google Inc. nor the names of its
28
+ // contributors may be used to endorse or promote products derived from
29
+ // this software without specific prior written permission.
30
+ //
31
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32
+ // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33
+ // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
34
+ // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35
+ // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
36
+ // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
37
+ // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
38
+ // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
39
+ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
40
+ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
41
+ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
42
+ =========================================================================================================
package/binding.gyp ADDED
@@ -0,0 +1,92 @@
1
+ {
2
+ "targets": [
3
+ {
4
+ "target_name": "keymapping",
5
+ "sources": [
6
+ "src/string_conversion.cc",
7
+ "src/keymapping.cc"
8
+ ],
9
+ 'cflags': [
10
+ '-O2', '-D_FORTIFY_SOURCE=2'
11
+ ],
12
+ 'msvs_configuration_attributes': {
13
+ 'SpectreMitigation': 'Spectre'
14
+ },
15
+ 'msvs_settings': {
16
+ 'VCCLCompilerTool': {
17
+ 'AdditionalOptions': [
18
+ '/guard:cf',
19
+ '/sdl',
20
+ '/W3',
21
+ '/w34244',
22
+ '/w34267',
23
+ '/ZH:SHA_256'
24
+ ]
25
+ },
26
+ 'VCLinkerTool': {
27
+ 'AdditionalOptions': [
28
+ '/DYNAMICBASE',
29
+ '/guard:cf'
30
+ ]
31
+ }
32
+ },
33
+ "conditions": [
34
+ ['OS=="linux"', {
35
+ "sources": [
36
+ "deps/chromium/x/keysym_to_unicode.cc",
37
+ "src/keyboard_x.cc"
38
+ ],
39
+ "include_dirs": [
40
+ "<!@(${PKG_CONFIG:-pkg-config} x11 xkbfile --cflags | sed s/-I//g)"
41
+ ],
42
+ "libraries": [
43
+ "<!@(${PKG_CONFIG:-pkg-config} x11 xkbfile --libs)"
44
+ ]
45
+ }],
46
+ ['OS=="freebsd"', {
47
+ "sources": [
48
+ "deps/chromium/x/keysym_to_unicode.cc",
49
+ "src/keyboard_x.cc"
50
+ ],
51
+ "include_dirs": [
52
+ "/usr/local/include"
53
+ ],
54
+ "link_settings": {
55
+ "libraries": [
56
+ "-lX11",
57
+ "-lxkbfile",
58
+ "-L/usr/local/lib"
59
+ ]
60
+ }
61
+ }],
62
+ ['OS=="win"', {
63
+ "sources": [
64
+ "src/keyboard_win.cc"
65
+ ]
66
+ }],
67
+ ['OS=="mac"', {
68
+ "sources": [
69
+ "src/keyboard_mac.mm"
70
+ ],
71
+ 'link_settings' : {
72
+ 'libraries' : [
73
+ '-framework Cocoa'
74
+ ]
75
+ }
76
+ }],
77
+ ['OS=="aix"', {
78
+ "sources": [
79
+ "deps/chromium/x/keysym_to_unicode.cc",
80
+ "src/keyboard_x.cc"
81
+ ],
82
+ "link_settings": {
83
+ "libraries": [
84
+ "-lX11",
85
+ "-lxkbfile"
86
+ ]
87
+ }
88
+ }]
89
+ ]
90
+ }
91
+ ]
92
+ }
@@ -0,0 +1 @@
1
+ b2fd9877d857f2b756bd8ac107840dd63b65e8613f8764c7af38ea200e87d2af native-keymap-3.3.7-258412-darwin-arm64.tar.gz
@@ -0,0 +1 @@
1
+ 61e81840f9c4d1b058987807cb6762e307e34dfaac5e66df01dce513cfda8137 native-keymap-3.3.7-258412-darwin-x64.tar.gz
@@ -0,0 +1 @@
1
+ 59f5b25556c9cbbc239431138b3f6c3e21f08a8d8bba245091ec043a5297f4c7 native-keymap-3.3.7-258412-linux-arm64.tar.gz
@@ -0,0 +1 @@
1
+ 7e328bc73cc8668f5c620cf2bbc43f906a041e9274976356052fd2f7de262a1c native-keymap-3.3.7-258412-linux-armhf.tar.gz
@@ -0,0 +1 @@
1
+ 4649674b066baebaeee2ab7affb96ead8496f12f7bbffb2f0f01c1dc4861cf3b native-keymap-3.3.7-258412-linux-loong64.tar.gz
@@ -0,0 +1 @@
1
+ aec80a65680ef54ac5711b62038d4a754f49547b69c8128354fdeb1175cfa15a native-keymap-3.3.7-258412-linux-ppc64le.tar.gz
@@ -0,0 +1 @@
1
+ 327ae5945d4fa49187598a9543e356bc41edf292aec559a15ba571749207cda4 native-keymap-3.3.7-258412-linux-riscv64.tar.gz
@@ -0,0 +1 @@
1
+ 04e0bb1dead00cc3d1a7fbf069d5b0b17cf08bbe0c57d2eef55b125ed6365735 native-keymap-3.3.7-258412-linux-s390x.tar.gz
@@ -0,0 +1 @@
1
+ ac2aa5136c94aed4b6fab4ad26f9fe755c4e7745e1251d24d46dc05cc9d87567 native-keymap-3.3.7-258412-linux-x64.tar.gz
@@ -0,0 +1 @@
1
+ a73eb41dbb28d49cdcfb9d9c4d3643e4aaf9cb72f61414a7765a2f3994b6518b *native-keymap-3.3.7-258412-win32-arm64.tar.gz
@@ -0,0 +1 @@
1
+ 1ccb734a7bc8d056d0b5ae8f88d9ab549cb19f12d1d4f66919e1091c2295b951 *native-keymap-3.3.7-258412-win32-x64.tar.gz