1
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Mac OS SierraにしたらKarabinerが使えないので苦労している

Posted at

#+STARTUP: indent content
import sys
import os
import datetime
import subprocess

from keyhac import *

def configure(keymap):
# --------------------------------------------------------------------
# Text editer setting for editting config.py file
# Setting with program file path (Simple usage)
if 1:
keymap.editor = "Sublime Text 2"

# Setting with callable object (Advanced usage)
if 0:
    def editor(path):
        subprocess.call([ "open", "-a", "TextEdit", path ])
    keymap.editor = editor


# --------------------------------------------------------------------
# Customizing the display

# Font
keymap.setFont( "Ricty", 20 )

# Theme
keymap.setTheme("black")


# --------------------------------------------------------------------

# clipboardは使わない    
keymap.clipboard_history.maxnum = 0

# Key replacement and modifier key definition
if 1:
    #英数キーはControl
    keymap.replaceKey(102, "LCtrl" )
    
    #かなキーはOption
    keymap.replaceKey(104, "Alt" )
    
    #FnキーをControlにしたがい挫折した
    keymap.replaceKey("RCmd", "RCtrl" )
  

# Global keymap which affects any windows
keymap_global = keymap.defineWindowKeymap()

#TabのかわりにFn+>
keymap_global[ "O-Fn-End" ] = "Tab"

#SpacekeyをControlとして使う
keymap.replaceKey("Space", "Shift")
keymap_global["D-Shift"] = "Shift"
keymap_global["O-Shift"] = "Space"
keymap_global["O-Space"] = "Space"

#英数+SpaceでReturn
keymap_global[ "LCtrl-D-Shift" ] = "Return"

#MacのシステムプレファレンスでControl+9で入力切り替えに変更しておく
#これで、かな+Spaceで入力切り替え
keymap_global[ "LAlt-D-Shift" ] = "LCtrl-9"

#SpaceをControlとして使う。押し放しでControlになる。
keymap_global[ "D-LShift-A" ] = "LCtrl-A"
keymap_global[ "D-RShift-A" ] = "Shift-A"

keymap_global[ "D-LShift-B" ] = "LCtrl-B"
keymap_global[ "D-RShift-B" ] = "Shift-B"

keymap_global[ "D-LShift-C" ] = "LCtrl-C"
keymap_global[ "D-RShift-C" ] = "Shift-C"

keymap_global[ "D-LShift-D" ] = "LCtrl-D"
keymap_global[ "D-RShift-D" ] = "Shift-D"

keymap_global[ "D-LShift-E" ] = "LCtrl-E"
keymap_global[ "D-RShift-E" ] = "Shift-E"

keymap_global[ "D-LShift-F" ] = "LCtrl-F"
keymap_global[ "D-RShift-F" ] = "Shift-F"

keymap_global[ "D-LShift-G" ] = "LCtrl-G"
keymap_global[ "D-RShift-G" ] = "Shift-G"

keymap_global[ "D-LShift-H" ] = "LCtrl-H"
keymap_global[ "D-RShift-H" ] = "Shift-H"

keymap_global[ "D-LShift-I" ] = "LCtrl-I"
keymap_global[ "D-RShift-I" ] = "Shift-I"

keymap_global[ "D-LShift-J" ] = "LCtrl-J"
keymap_global[ "D-RShift-J" ] = "Shift-J"

keymap_global[ "D-LShift-K" ] = "LCtrl-K"
keymap_global[ "D-RShift-K" ] = "Shift-K"

keymap_global[ "D-LShift-L" ] = "LCtrl-L"
keymap_global[ "D-RShift-L" ] = "Shift-L"

keymap_global[ "D-LShift-M" ] = "LCtrl-M"
keymap_global[ "D-RShift-M" ] = "Shift-M"

keymap_global[ "D-LShift-N" ] = "LCtrl-N"
keymap_global[ "D-RShift-N" ] = "Shift-N"

keymap_global[ "D-LShift-O" ] = "LCtrl-O"
keymap_global[ "D-RShift-O" ] = "Shift-O"

keymap_global[ "D-LShift-P" ] = "LCtrl-P"
keymap_global[ "D-RShift-P" ] = "Shift-P"

keymap_global[ "D-LShift-Q" ] = "LCtrl-Q"
keymap_global[ "D-RShift-Q" ] = "Shift-Q"

keymap_global[ "D-LShift-R" ] = "LCtrl-R"
keymap_global[ "D-RShift-R" ] = "Shift-R"

keymap_global[ "D-LShift-S" ] = "LCtrl-S"
keymap_global[ "D-RShift-S" ] = "Shift-S"

keymap_global[ "D-LShift-T" ] = "LCtrl-T"
keymap_global[ "D-RShift-T" ] = "Shift-T"

keymap_global[ "D-LShift-U" ] = "LCtrl-U"
keymap_global[ "D-RShift-U" ] = "Shift-U"

keymap_global[ "D-LShift-V" ] = "LCtrl-V"
keymap_global[ "D-RShift-V" ] = "Shift-V"

keymap_global[ "D-LShift-W" ] = "LCtrl-W"
keymap_global[ "D-RShift-W" ] = "Shift-W"

keymap_global[ "D-LShift-X" ] = "LCtrl-X"
keymap_global[ "D-RShift-X" ] = "Shift-X"

keymap_global[ "D-LShift-Y" ] = "LCtrl-Y"
keymap_global[ "D-RShift-Y" ] = "Shift-Y"

keymap_global[ "D-LShift-Z" ] = "LCtrl-Z"
keymap_global[ "D-RShift-Z" ] = "Shift-Z"

keymap_global[ "D-LShift-1" ] = "LCtrl-1"
keymap_global[ "D-RShift-1" ] = "Shift-1"

keymap_global[ "D-LShift-2" ] = "LCtrl-2"
keymap_global[ "D-RShift-2" ] = "Shift-2"

keymap_global[ "D-LShift-3" ] = "LCtrl-3"
keymap_global[ "D-RShift-3" ] = "Shift-3"

keymap_global[ "D-LShift-4" ] = "LCtrl-4"
keymap_global[ "D-RShift-4" ] = "Shift-4"

keymap_global[ "D-LShift-5" ] = "LCtrl-5"
keymap_global[ "D-RShift-5" ] = "Shift-5"

keymap_global[ "D-LShift-6" ] = "LCtrl-6"
keymap_global[ "D-RShift-6" ] = "Shift-6"

keymap_global[ "D-LShift-7" ] = "LCtrl-7"
keymap_global[ "D-RShift-7" ] = "Shift-7"

keymap_global[ "D-LShift-8" ] = "LCtrl-8"
keymap_global[ "D-RShift-8" ] = "Shift-8"

keymap_global[ "D-LShift-9" ] = "LCtrl-9"
keymap_global[ "D-RShift-9" ] = "Shift-9"

keymap_global[ "D-LShift-0" ] = "LCtrl-0"
keymap_global[ "D-RShift-0" ] = "Shift-0"

keymap_global[ "D-LShift-Caret" ] = "LCtrl-Caret"
keymap_global[ "D-RShift-Caret" ] = "Shift-Caret"

新しいMacBookProになっていろいろ不便ですが、これで一応使えるように
なりました。
打鍵圧が高いので、キー入力が疲れますorz

1
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?