Created
October 1, 2018 14:39
-
-
Save miyataka/534a92123f9f777a7f8072a6e01810a0 to your computer and use it in GitHub Desktop.
my keyhac config file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import os | |
from keyhac import * | |
import ckit | |
def configure(keymap): | |
not_change_target = [ | |
"com.googlecode.iterm2", | |
"com.apple.Terminal", | |
] | |
class Fakeymacs: | |
pass | |
fakeymacs = Fakeymacs() | |
fakeymacs.last_window = None | |
def is_change_target(window): | |
if window != fakeymacs.last_window: | |
fakeymacs.last_window = window | |
# print(ckit.getApplicationNameByPid(window.pid)) | |
if ckit.getApplicationNameByPid(window.pid) in not_change_target: | |
return False | |
return True | |
keymap_change = keymap.defineWindowKeymap(check_func=is_change_target) | |
keymap_change[ "Ctrl-X" ] = "Cmd-X" # Cut | |
keymap_change[ "Ctrl-C" ] = "Cmd-C" # Copy | |
keymap_change[ "Ctrl-V" ] = "Cmd-V" # Paste | |
keymap_change[ "Ctrl-Z" ] = "Cmd-Z" # Undo | |
keymap_change[ "Ctrl-L" ] = "Cmd-L" # Forcus Address bar | |
keymap_change[ "Ctrl-W" ] = "Cmd-W" # Close | |
keymap_change[ "Ctrl-Q" ] = "Cmd-Q" # Quit | |
keymap_change[ "Ctrl-T" ] = "Cmd-T" # Create Tab | |
keymap_change[ "Ctrl-R" ] = "Cmd-R" # Search command | |
# keymap_change[ “LShift-Ctrl-B“ ] = "LShift-Cmd-B” # toggle BookmarkBar on Chrome |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment