Skip to content

Instantly share code, notes, and snippets.

@fand fand/config.py
Created Jun 21, 2018

Embed
What would you like to do?
keyhac config for amagi
import sys
import os
import datetime
import pyauto
from keyhac import *
def configure(keymap):
keymap.editor = "Atom.exe"
keymap.setFont("MS Gothic", 12)
keymap.setTheme("black")
keymap_global = keymap.defineWindowKeymap()
# Cursor
keymap_global[ "C-P" ] = "Up"
keymap_global[ "C-N" ] = "Down"
keymap_global[ "C-F" ] = "Right"
keymap_global[ "C-B" ] = "Left"
keymap_global[ "C-A" ] = "Home"
keymap_global[ "C-E" ] = "End"
keymap_global[ "C-V" ] = "PageDown"
keymap_global[ "A-V" ] = "PageUp"
keymap_global[ "A-Comma" ] = "C-Home"
keymap_global[ "A-Period" ] = "C-End"
keymap_global[ "S-C-P" ] = "S-Up"
keymap_global[ "S-C-N" ] = "S-Down"
keymap_global[ "S-C-F" ] = "S-Right"
keymap_global[ "S-C-B" ] = "S-Left"
keymap_global[ "S-C-A" ] = "S-Home"
keymap_global[ "S-C-E" ] = "S-End"
keymap_global[ "S-C-V" ] = "S-PageDown"
keymap_global[ "S-A-V" ] = "S-PageUp"
keymap_global[ "S-A-Comma" ] = "S-C-Home"
keymap_global[ "S-A-Period" ] = "S-C-End"
# Ctrl bindings
keymap_global[ "C-D" ] = "Delete" # Delete
keymap_global[ "C-H" ] = "Back" # Backspace
keymap_global[ "C-W" ] = "C-X" # Cut
keymap_global[ "C-Y" ] = "C-V" # Paste
keymap_global[ "C-(191)" ] = "C-Z" # Undo
keymap_global[ "C-K" ] = "S-End","C-X" # Removing following text
keymap_global[ "C-J" ] = "Enter"
# Ctrl押しっぱなしになってしまうので、Ctrlをもう一度押して解除する関数
withC = lambda x: (x, "D-Ctrl", "U-Ctrl")
# Alt as Command
keymap_global[ "A-C" ] = withC("C-C") # Copy
keymap_global[ "A-V" ] = withC("C-V") # Paste
keymap_global[ "A-F" ] = withC("C-F") # Find
keymap_global[ "A-T" ] = withC("C-T") # New Tab
keymap_global[ "A-W" ] = withC("C-W") # Close Tab
keymap_global[ "A-L" ] = withC("C-L") # Focus URL bar
keymap_global[ "A-A" ] = withC("C-A") # Select All
keymap_global[ "A-S" ] = withC("C-S") # Save
keymap_global[ "A-K" ] = withC("C-K") # Channels
# Tabs
keymap_global[ "A-1" ] = withC("C-1")
keymap_global[ "A-2" ] = withC("C-2")
keymap_global[ "A-3" ] = withC("C-3")
keymap_global[ "A-4" ] = withC("C-4")
keymap_global[ "A-5" ] = withC("C-5")
keymap_global[ "A-6" ] = withC("C-6")
keymap_global[ "A-7" ] = withC("C-7")
keymap_global[ "A-8" ] = withC("C-8")
keymap_global[ "A-9" ] = withC("C-9")
keymap_global[ "A-0" ] = withC("C-0")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.