hardwired
10/26/2016 - 2:59 PM

enthumble like keybind for Keyhac(Mac)

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 = "Brackets"

    # Setting with callable object (Advanced usage)
    #if 0:
    #    def editor(path):
    #        shellExecute( None, "notepad.exe", '"%s"'% path, "" )
    #    keymap.editor = editor

    # --------------------------------------------------------------------
    # Customsizing the display

    # Font
    keymap.setFont( "Osaka-Mono", 16 )

    # Theme
    keymap.setTheme("black")

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

    # Simple key replacement
    # keymap.replaceKey( "CapsLock", "LCtrl" )

    # User modifier key definition "Muhenkan"
    keymap.defineModifier( 102, "User0" )

    # Global keymap which affects any windows
    # enthumble like keybind

    if 1:
        keymap_global = keymap.defineWindowKeymap()

        # USER0-I/J/K/L : Move Cursor and backspace
        keymap_global[ "User0-I"  ] = "Up"
        keymap_global[ "User0-J" ] = "Left"
        keymap_global[ "User0-K"    ] = "Down"
        keymap_global[ "User0-L"  ] = "Right"

        keymap_global[ "User0-LShift-I"  ] = "LShift-Up"
        keymap_global[ "User0-LShift-J" ] = "LShift-Left"
        keymap_global[ "User0-LShift-K"    ] = "LShift-Down"
        keymap_global[ "User0-LShift-L"  ] = "LShift-Right"

        keymap_global[ "User0-S"  ] = "LCmd-S"
        keymap_global[ "User0-Z"  ] = "LCmd-Z"
        keymap_global[ "User0-A"  ] = "LCmd-A"
        keymap_global[ "User0-C"  ] = "LCmd-C"
        keymap_global[ "User0-V"  ] = "LCmd-V"

        keymap_global[ "User0-O"  ] = "Back"
        keymap_global[ "User0-Space"  ] = "Enter"
        keymap_global[ "User0-104"  ] = "Esc"

        keymap_global[ "O-102"  ] = "102"

        #def minimize_window():
        #  wnd = keymap.getTopLevelWindow()
        #  if wnd and not wnd.isMinimized():
        #    wnd.minimize()

        #keymap_global[ "User0-Atmark"  ] = minimize_window