MacOS版 Microsoft Remote Desktop の JIS → USキーボード問題を Karabiner-Elements で解決

【2024/10/19 追記】
Windows11 のファイルダイアログで Shift + F1 を入力すると、エクスプローラのヘルプが起動してしまうようになったため Shift + F2 で登録するとよいです

【2020/5/16 追記】
Microsoft Remote Desktop Ver.10.3.10 で、下記のキーボード問題は解消されたようです


久々に在宅ワークになったら、MacからRDPの記号がマトモに入らなくなっていたので、結局 Karabiner-Elements(JIS → US変換)で対策に至ったメモ

コレ、前からダメだったっけ?と思いながら検索すると、ストアにある Parallels RDP Client で接続するのが定番らしく、早速インストールして、しばらく使ってみたが ctrl + tab が効かない等、個人的に許せない箇所がポツポツと...
で、純正の Microsoft Remote Desktop (記述時点で ver. 10.3.9)で何とかしようとした話

まず、Keyborad Mode を Scancode から Unicode へ切り替えると、なんと記号がマトモに入るように!!

喜びもつかの間、日本語入力に切り替えた途端、文字がずれて全く使い物になりません(w

結局、 Karabiner-Elements と Karabiner-EventViwer でコツコツとキーを探して jsonを作成

下記の json は、よくある「かな漢字切り替え」のキーを Shift + F1 で切り替えるようにWindows側で設定しておいて、Macの「かな」キーを Shift + F1 へ変換するようにしています (↓Google 日本語入力の場合、各状態に Shift + F1 などを追加)
 
ので、別のキーへアサインしている方は、変更してください(一番最初の定義です)

また、一番最後の定義で shift +「ろ」(international1)でバックスラッシュを定義していますので、不要な方は消したりしてください。それ以外は、キーボードの記載通りのハズです


jis2us.json
  1. {  
  2.   "title""JIS配列 → US配列変換(RDP)",  
  3.   "rules": [  
  4.     {  
  5.       "description""かなキーIMEトグル(RDP)",  
  6.       "manipulators": [  
  7.         {  
  8.           "type""basic",  
  9.           "description""かなキーを Shift + F1 へ変換(RDP)",  
  10.           "from": {  
  11.             "key_code""japanese_kana"  
  12.           },  
  13.           "to": [  
  14.             {  
  15.               "key_code""f1",  
  16.               "modifiers": [ "shift" ]  
  17.             }  
  18.           ],  
  19.           "conditions": [  
  20.             {  
  21.               "type""frontmost_application_if",  
  22.               "bundle_identifiers": [  
  23.                 "^com\\.microsoft\\.rdc\\."  
  24.               ]  
  25.             }  
  26.           ]  
  27.         }  
  28.       ]  
  29.     },  
  30.    
  31.     {  
  32.       "description""JIS配列 → US配列変換(RDP)",  
  33.       "manipulators": [  
  34.         {  
  35.           "type""basic",  
  36.           "from": {  
  37.             "key_code""2",  
  38.             "modifiers": { "mandatory": [ "shift" ] }  
  39.           },  
  40.           "to": [  
  41.             {  
  42.               "key_code""quote",  
  43.               "modifiers": [ "shift" ]  
  44.             }  
  45.           ],  
  46.           "conditions": [  
  47.             {  
  48.               "type""frontmost_application_if",  
  49.               "bundle_identifiers": [  
  50.                 "^com\\.microsoft\\.rdc\\."  
  51.               ]  
  52.             }  
  53.           ]  
  54.         },  
  55.   
  56.         {  
  57.           "type""basic",  
  58.           "from": {  
  59.             "key_code""6",  
  60.             "modifiers": { "mandatory": [ "shift" ] }  
  61.           },  
  62.           "to": [  
  63.             {  
  64.               "key_code""7",  
  65.               "modifiers": [ "shift" ]  
  66.             }  
  67.           ],  
  68.           "conditions": [  
  69.             {  
  70.               "type""frontmost_application_if",  
  71.               "bundle_identifiers": [  
  72.                 "^com\\.microsoft\\.rdc\\."  
  73.               ]  
  74.             }  
  75.           ]  
  76.         },  
  77.   
  78.         {  
  79.           "type""basic",  
  80.           "from": {  
  81.             "key_code""7",  
  82.             "modifiers": { "mandatory": [ "shift" ] }  
  83.           },  
  84.           "to": [  
  85.             {  
  86.               "key_code""quote",  
  87.               "modifiers": [ ]  
  88.             }  
  89.           ],  
  90.           "conditions": [  
  91.             {  
  92.               "type""frontmost_application_if",  
  93.               "bundle_identifiers": [  
  94.                 "^com\\.microsoft\\.rdc\\."  
  95.               ]  
  96.             }  
  97.           ]  
  98.         },  
  99.   
  100.         {  
  101.           "type""basic",  
  102.           "from": {  
  103.             "key_code""8",  
  104.             "modifiers": { "mandatory": [ "shift" ] }  
  105.           },  
  106.           "to": [  
  107.             {  
  108.               "key_code""9",  
  109.               "modifiers": [ "shift" ]  
  110.             }  
  111.           ],  
  112.           "conditions": [  
  113.             {  
  114.               "type""frontmost_application_if",  
  115.               "bundle_identifiers": [  
  116.                 "^com\\.microsoft\\.rdc\\."  
  117.               ]  
  118.             }  
  119.           ]  
  120.         },  
  121.   
  122.         {  
  123.           "type""basic",  
  124.           "from": {  
  125.             "key_code""9",  
  126.             "modifiers": { "mandatory": [ "shift" ] }  
  127.           },  
  128.           "to": [  
  129.             {  
  130.               "key_code""0",  
  131.               "modifiers": [ "shift" ]  
  132.             }  
  133.           ],  
  134.           "conditions": [  
  135.             {  
  136.               "type""frontmost_application_if",  
  137.               "bundle_identifiers": [  
  138.                 "^com\\.microsoft\\.rdc\\."  
  139.               ]  
  140.             }  
  141.           ]  
  142.         },  
  143.   
  144.         {  
  145.           "type""basic",  
  146.           "from": {  
  147.             "key_code""0",  
  148.             "modifiers": { "mandatory": [ "shift" ] }  
  149.           },  
  150.           "to": [  
  151.             {  
  152.               "key_code""vk_none",  
  153.               "modifiers": [ ]  
  154.             }  
  155.           ],  
  156.           "conditions": [  
  157.             {  
  158.               "type""frontmost_application_if",  
  159.               "bundle_identifiers": [  
  160.                 "^com\\.microsoft\\.rdc\\."  
  161.               ]  
  162.             }  
  163.           ]  
  164.         },  
  165.   
  166.         {  
  167.           "type""basic",  
  168.           "from": {  
  169.             "key_code""hyphen",  
  170.             "modifiers": { "mandatory": [ "shift" ] }  
  171.           },  
  172.           "to": [  
  173.             {  
  174.               "key_code""equal_sign",  
  175.               "modifiers": [ ]  
  176.             }  
  177.           ],  
  178.           "conditions": [  
  179.             {  
  180.               "type""frontmost_application_if",  
  181.               "bundle_identifiers": [  
  182.                 "^com\\.microsoft\\.rdc\\."  
  183.               ]  
  184.             }  
  185.           ]  
  186.         },  
  187.   
  188.         {  
  189.           "type""basic",  
  190.           "from": {  
  191.             "key_code""equal_sign",  
  192.             "modifiers": { "mandatory": [ ] }  
  193.           },  
  194.           "to": [  
  195.             {  
  196.               "key_code""6",  
  197.               "modifiers": [ "shift" ]  
  198.             }  
  199.           ],  
  200.           "conditions": [  
  201.             {  
  202.               "type""frontmost_application_if",  
  203.               "bundle_identifiers": [  
  204.                 "^com\\.microsoft\\.rdc\\."  
  205.               ]  
  206.             }  
  207.           ]  
  208.         },  
  209.   
  210.         {  
  211.           "type""basic",  
  212.           "from": {  
  213.             "key_code""equal_sign",  
  214.             "modifiers": { "mandatory": [ "shift" ] }  
  215.           },  
  216.           "to": [  
  217.             {  
  218.               "key_code""grave_accent_and_tilde",  
  219.               "modifiers": [ "shift" ]  
  220.             }  
  221.           ],  
  222.           "conditions": [  
  223.             {  
  224.               "type""frontmost_application_if",  
  225.               "bundle_identifiers": [  
  226.                 "^com\\.microsoft\\.rdc\\."  
  227.               ]  
  228.             }  
  229.           ]  
  230.         },  
  231.   
  232.         {  
  233.           "type""basic",  
  234.           "from": {  
  235.             "key_code""open_bracket",  
  236.             "modifiers": { "mandatory": [ ] }  
  237.           },  
  238.           "to": [  
  239.             {  
  240.               "key_code""2",  
  241.               "modifiers": [ "shift" ]  
  242.             }  
  243.           ],  
  244.           "conditions": [  
  245.             {  
  246.               "type""frontmost_application_if",  
  247.               "bundle_identifiers": [  
  248.                 "^com\\.microsoft\\.rdc\\."  
  249.               ]  
  250.             }  
  251.           ]  
  252.         },  
  253.           
  254.         {  
  255.           "type""basic",  
  256.           "from": {  
  257.             "key_code""close_bracket",  
  258.             "modifiers": { "mandatory": [ ] }  
  259.           },  
  260.           "to": [  
  261.             {  
  262.               "key_code""open_bracket",  
  263.               "modifiers": [  ]  
  264.             }  
  265.           ],  
  266.           "conditions": [  
  267.             {  
  268.               "type""frontmost_application_if",  
  269.               "bundle_identifiers": [  
  270.                 "^com\\.microsoft\\.rdc\\."  
  271.               ]  
  272.             }  
  273.           ]  
  274.         },  
  275.   
  276.         {  
  277.           "type""basic",  
  278.           "from": {  
  279.             "key_code""backslash",  
  280.             "modifiers": { "mandatory": [ ] }  
  281.           },  
  282.           "to": [  
  283.             {  
  284.               "key_code""close_bracket",  
  285.               "modifiers": [  ]  
  286.             }  
  287.           ],  
  288.           "conditions": [  
  289.             {  
  290.               "type""frontmost_application_if",  
  291.               "bundle_identifiers": [  
  292.                 "^com\\.microsoft\\.rdc\\."  
  293.               ]  
  294.             }  
  295.           ]  
  296.         },  
  297.   
  298.         {  
  299.           "type""basic",  
  300.           "from": {  
  301.             "key_code""quote",  
  302.             "modifiers": { "mandatory": [ ] }  
  303.           },  
  304.           "to": [  
  305.             {  
  306.               "key_code""semicolon",  
  307.               "modifiers": [ "shift" ]  
  308.             }  
  309.           ],  
  310.           "conditions": [  
  311.             {  
  312.               "type""frontmost_application_if",  
  313.               "bundle_identifiers": [  
  314.                 "^com\\.microsoft\\.rdc\\."  
  315.               ]  
  316.             }  
  317.           ]  
  318.         },  
  319.   
  320.         {  
  321.           "type""basic",  
  322.           "from": {  
  323.             "key_code""semicolon",  
  324.             "modifiers": { "mandatory": [ "shift" ] }  
  325.           },  
  326.           "to": [  
  327.             {  
  328.               "key_code""equal_sign",  
  329.               "modifiers": [ "shift" ]  
  330.             }  
  331.           ],  
  332.           "conditions": [  
  333.             {  
  334.               "type""frontmost_application_if",  
  335.               "bundle_identifiers": [  
  336.                 "^com\\.microsoft\\.rdc\\."  
  337.               ]  
  338.             }  
  339.           ]  
  340.         },  
  341.   
  342.         {  
  343.           "type""basic",  
  344.           "from": {  
  345.             "key_code""quote",  
  346.             "modifiers": { "mandatory": [ "shift" ] }  
  347.           },  
  348.           "to": [  
  349.             {  
  350.               "key_code""8",  
  351.               "modifiers": [ "shift" ]  
  352.             }  
  353.           ],  
  354.           "conditions": [  
  355.             {  
  356.               "type""frontmost_application_if",  
  357.               "bundle_identifiers": [  
  358.                 "^com\\.microsoft\\.rdc\\."  
  359.               ]  
  360.             }  
  361.           ]  
  362.         },  
  363.   
  364.         {  
  365.           "type""basic",  
  366.           "from": {  
  367.             "key_code""open_bracket",  
  368.             "modifiers": { "mandatory": [ "shift" ] }  
  369.           },  
  370.           "to": [  
  371.             {  
  372.               "key_code""grave_accent_and_tilde",  
  373.               "modifiers": [ ]  
  374.             }  
  375.           ],  
  376.           "conditions": [  
  377.             {  
  378.               "type""frontmost_application_if",  
  379.               "bundle_identifiers": [  
  380.                 "^com\\.microsoft\\.rdc\\."  
  381.               ]  
  382.             }  
  383.           ]  
  384.         },  
  385.   
  386.         {  
  387.           "type""basic",  
  388.           "from": {  
  389.             "key_code""close_bracket",  
  390.             "modifiers": { "mandatory": [ "shift" ] }  
  391.           },  
  392.           "to": [  
  393.             {  
  394.               "key_code""open_bracket",  
  395.               "modifiers": [ "shift" ]  
  396.             }  
  397.           ],  
  398.           "conditions": [  
  399.             {  
  400.               "type""frontmost_application_if",  
  401.               "bundle_identifiers": [  
  402.                 "^com\\.microsoft\\.rdc\\."  
  403.               ]  
  404.             }  
  405.           ]  
  406.         },  
  407.   
  408.         {  
  409.           "type""basic",  
  410.           "from": {  
  411.             "key_code""backslash",  
  412.             "modifiers": { "mandatory": [ "shift" ] }  
  413.           },  
  414.           "to": [  
  415.             {  
  416.               "key_code""close_bracket",  
  417.               "modifiers": [ "shift" ]  
  418.             }  
  419.           ],  
  420.           "conditions": [  
  421.             {  
  422.               "type""frontmost_application_if",  
  423.               "bundle_identifiers": [  
  424.                 "^com\\.microsoft\\.rdc\\."  
  425.               ]  
  426.             }  
  427.           ]  
  428.         },  
  429.   
  430.         {  
  431.           "type""basic",  
  432.           "from": {  
  433.             "key_code""international1",  
  434.             "modifiers": { "mandatory": [ "shift" ] }  
  435.           },  
  436.           "to": [  
  437.             {  
  438.               "key_code""backslash",  
  439.               "modifiers": [ ]  
  440.             }  
  441.           ],  
  442.           "conditions": [  
  443.             {  
  444.               "type""frontmost_application_if",  
  445.               "bundle_identifiers": [  
  446.                 "^com\\.microsoft\\.rdc\\."  
  447.               ]  
  448.             }  
  449.           ]  
  450.         }  
  451.   
  452.       ]  
  453.     }  
  454.  ]  
  455. }  


かなトグルの説明と画像が兼用なのをご了承ください
既に Karabiner-Elements を設定して利用している場合、Profilesから新しいプロファイルを作成してお試しください
  1. Karabiner-Elements のデータフォルダを開いて
  2. assets/complex_modifications に 上記の jis2us.json (UTF-8 であればファイル名は何でもよい)を作成またはコピペ
  3. Add rule を開いて
  4. JIS配列 → US配列変換(RDP) を Enable All で取り込む
    jsonが正しくない場合ココに表示されません
  5. 取り込まれて利用可能になるハズ

    ※jsonファイルを変更した時は、ここで Removeの後、再度取り込む必要があります

コメント