I'm glad I got the new MacBook Pro, but since it's Sierra from the beginning, the question was what to do with Karabiner. First of all, I tried to move to Karabiner-Elements, but it failed, and it was a recourse keyhac for Mac .com / site / craftware / keyhac-ja) is also at a loss because the most important settings cannot be realized.
If Vim cannot be used as it is, it will lead to a gradual death, so fortunately I would like to improve keyhac whose source is open to the public to overcome it. Specifically, the goals are as follows.
https://github.com/crftwr/keyhac/wiki
Prepare pyenv with anyenv and install Python 3.4.5 with pyenv. For the time being, I made it global without using virtualenv.
Install the following packages listed on the wiki using pip3.4
(although if you specify 3.4.5 globally, pip
is also 3.4.5).
keyhac
and ckit
should clone
in the same hierarchy and check out the mac_port
branch respectively.
An error occurs when building ckit with Xcode.
I prepared a Python 3.4 environment using pyenv, so the cause is that the path to the header directory does not pass.
The original setting was /Library/Frameworks/Python.framework/Versions/3.4/Headers
, but in the last few generations of macOS it has moved to /System/Library/Frameworks/Python.framework
. There is. I wondered if I didn't need pyenv if there was 3.4 here, but when I looked at the destination, it was only up to 2.7, so pyenv wasn't wasted.
Change the header directory path to /Users/<username>/.anyenv/envs/pyenv/versions/3.4.5/include/python3.4m
.
Redefinition of enumerator 'kVK_RightCommand'
/path/to/ckit/ckitcore/mac/ckitcore/ckitcore_hook_mac.cpp:49:5: Redefinition of enumerator 'kVK_RightCommand'
An error that looks like an enum duplicate definition. I commented out for the time being.
before.cpp
enum AdditionalVk
{
kVK_RightCommand = 0x36,
};
after.cpp
enum AdditionalVk
{
// kVK_RightCommand = 0x36,
};
There was an error in the link near the end of the build. Python in Support Files has a reference error and needs to be resolved. However, if you normally install Python with pyenv, only a static library will be generated, so if you want a dynamic link library, you need to install it with the --enable-framework
option ([reference link](https:: https:: //github.com/yyuu/pyenv/issues/99)).
$ env PYTHON_CONFIGURE_OPTS="--enable-framework" pyenv install 3.4.5
After the installation is complete, Python.framework will appear under /Users/<username>/.anyenv/envs/pyenv/versions/3.4.5
, so change the header directory and dylib path here.
/Users/<username>/.anyenv/envs/pyenv/versions/3.4.5/Python.framework/Headers
/Users/<username>/.anyenv/envs/pyenv/versions/3.4.5/Python.framework/Python
The build will succeed once, but there is a warning that a directory that does not exist is specified at the time of linking. I was wondering where to set it, but I found the old path in TARGETS's Library Search Paths, so point it to pyenv's Python.framework.
Now the warning disappears and the ckit build is complete. There are two code warnings that haven't been reached yet, but ignore them for now.
There was an instruction to make a symbolic link on the wiki, but ckitcore.so was created without doing anything, so I will start it.
$ python keyhac_main.py -d
Unfortunately, an error occurred again.
Traceback (most recent call last):
File "keyhac_main.py", line 19, in <module>
import keyhac_keymap
File "/Users/kodama/Work/keyhac/keyhac_keymap.py", line 17, in <module>
import accessibility
ImportError: No module named 'accessibility'
iTerm.app wasn't on the accessibility allow list, so I added it and re-run it, but I get the same error. Try installing accessibility with pip obediently.
$ pip install accessibility
You have successfully started keyhac.
Recommended Posts