deckide 3.5.39 → 3.5.40

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.
@@ -1369,7 +1369,34 @@ function getWindowsVirtualKeyCode(key) {
1369
1369
  return 111 + Number(functionKey[1]);
1370
1370
  }
1371
1371
  if (key.length === 1) {
1372
- return key.toUpperCase().charCodeAt(0);
1372
+ // 英字・数字は ASCII コードがそのまま VK コードと一致する。
1373
+ if (/[a-zA-Z0-9]/.test(key)) {
1374
+ return key.toUpperCase().charCodeAt(0);
1375
+ }
1376
+ // 記号は charCodeAt だと VK コードと衝突する(例: '.' は ASCII 46 = VK_DELETE
1377
+ // で、Delete キー扱いになり文字が消える)。US 配列の OEM コードに明示マップする。
1378
+ // shift 併用の記号(! @ # ... > など)も対応する物理キーの VK にマップ。
1379
+ const symbolToVk = {
1380
+ ')': 48, '!': 49, '@': 50, '#': 51, '$': 52,
1381
+ '%': 53, '^': 54, '&': 55, '*': 56, '(': 57,
1382
+ ';': 186, ':': 186,
1383
+ '=': 187, '+': 187,
1384
+ ',': 188, '<': 188,
1385
+ '-': 189, '_': 189,
1386
+ '.': 190, '>': 190,
1387
+ '/': 191, '?': 191,
1388
+ '`': 192, '~': 192,
1389
+ '[': 219, '{': 219,
1390
+ '\\': 220, '|': 220,
1391
+ ']': 221, '}': 221,
1392
+ "'": 222, '"': 222,
1393
+ };
1394
+ if (key in symbolToVk) {
1395
+ return symbolToVk[key];
1396
+ }
1397
+ // 不明な1文字は 0 を返す。text は別途渡しているので文字入力自体は成立し、
1398
+ // 特殊キーとして誤解釈されることもない。
1399
+ return 0;
1373
1400
  }
1374
1401
  return 0;
1375
1402
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deckide",
3
- "version": "3.5.39",
3
+ "version": "3.5.40",
4
4
  "description": "Deck IDE - Browser-based IDE with terminal, file explorer, and git integration",
5
5
  "type": "module",
6
6
  "bin": {