Skip to content

Commit

Permalink
fn + hjkl => arrow keys
Browse files Browse the repository at this point in the history
  • Loading branch information
Casey Watson committed Nov 5, 2016
1 parent 01c0891 commit 5531032
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/core/grabber/include/manipulator/event_manipulator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,18 @@ class event_manipulator final {
case krbn::key_code::up_arrow:
key_code = krbn::key_code::page_up;
break;
case krbn::key_code::h:
key_code = krbn::key_code::left_arrow;
break;
case krbn::key_code::j:
key_code = krbn::key_code::down_arrow;
break;
case krbn::key_code::k:
key_code = krbn::key_code::up_arrow;
break;
case krbn::key_code::l:
key_code = krbn::key_code::right_arrow;
break;
default:
break;
}
Expand Down
5 changes: 5 additions & 0 deletions src/share/types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ enum class key_code : uint32_t {
keypad_equal_sign = kHIDUsage_KeypadEqualSign,
keypad_comma = kHIDUsage_KeypadComma,

h = kHIDUsage_KeyboardH,
j = kHIDUsage_KeyboardJ,
k = kHIDUsage_KeyboardK,
l = kHIDUsage_KeyboardL,

home = kHIDUsage_KeyboardHome,
page_up = kHIDUsage_KeyboardPageUp,
delete_forward = kHIDUsage_KeyboardDeleteForward,
Expand Down

11 comments on commit 5531032

@lieutenantfly
Copy link

@lieutenantfly lieutenantfly commented on 5531032 Dec 15, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, how can we use it?

@watsoncj
Copy link
Owner

@watsoncj watsoncj commented on 5531032 Dec 15, 2016 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lieutenantfly
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@watsoncj get it ,thx.

@YoonjaeYoo
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super thanks! This is what I've been looking for!

@diegodesouza
Copy link

@diegodesouza diegodesouza commented on 5531032 Feb 5, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cloned the app and getting weird error

./make-package.sh
make build
..............................................................** BUILD FAILED **


The following build commands failed:
	CompileC build/libkrbn.build/Release/libkrbn.build/Objects-normal/x86_64/libkrbn_system_preferences_monitor.o libkrbn_system_preferences_monitor.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
make[4]: *** [all] Error 65
make[3]: *** [all] Error 2
make[2]: *** [all] Error 2
make[1]: *** [build] Error 2

make: *** [all] Error 99

Edit: I need to install the boost-header brew install booster did it for me.

@watsoncj
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Glad you figured it out. I didn't realize you could install boost with Homebrew. That's good to know.

@diegodesouza
Copy link

@diegodesouza diegodesouza commented on 5531032 Feb 6, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I thought i had it going, until it got stuck for a while then got some errors, I still can install the .dmg and run it, but the fn + hjkl dosn't work, unless i need to activate it somehow ? @watsoncj

Edit: restarting my machine did the trick. Still not sure about the keychain error though.

error: The specified item could not be found in the keychain.
code sign Library/Application Support/org.pqrs/Karabiner-Elements/updater/Karabiner-Elements.app
error: The specified item could not be found in the keychain.
code sign Library/Application Support/org.pqrs/Karabiner-Elements/bin/karabiner_grabber
error: The specified item could not be found in the keychain.
code sign Library/Application Support/org.pqrs/Karabiner-Elements/bin/karabiner_console_user_server
error: The specified item could not be found in the keychain.
code sign Library/Application Support/org.pqrs/Karabiner-Elements/Karabiner-Menu.app
error: The specified item could not be found in the keychain.
code sign Applications/Karabiner-EventViewer.app
error: The specified item could not be found in the keychain.
code sign Applications/Karabiner-Elements.app
error: The specified item could not be found in the keychain.
Library/Application Support/org.pqrs/Karabiner-Elements/updater/Karabiner-Elements.app/Contents/Frameworks/Sparkle.framework/Versions/A/Resources/Autoupdate.app: code object is not signed at all
In architecture: x86_64
Library/Application Support/org.pqrs/Karabiner-Elements/updater/Karabiner-Elements.app: code object is not signed at all
In architecture: x86_64
Library/Application Support/org.pqrs/Karabiner-Elements/bin/karabiner_grabber: code object is not signed at all
In architecture: x86_64
Library/Application Support/org.pqrs/Karabiner-Elements/bin/karabiner_console_user_server: code object is not signed at all
In architecture: x86_64
Library/Application Support/org.pqrs/Karabiner-Elements/Karabiner-Menu.app: code object is not signed at all
In architecture: x86_64
Applications/Karabiner-EventViewer.app: code object is not signed at all
In architecture: x86_64
Applications/Karabiner-Elements.app: code object is not signed at all
In architecture: x86_64
Create pkg
pkgbuild: Reading components from pkginfo/pkgbuild.plist
pkgbuild: Adding component at Applications/Karabiner-Elements.app
pkgbuild: Adding top-level preinstall script
pkgbuild: Adding top-level postinstall script
pkgbuild: Wrote package to Karabiner-Elements-0.90.86/Installer.pkg
productbuild: Wrote product to Karabiner-Elements-0.90.86/Karabiner-Elements.sparkle_guided.pkg
Sign with Developer ID
productsign: error: Could not find appropriate signing identity for “79E265756C43F62E157DB5C8FA405B54428653F9”.
Make Archive
.................................
created: /Users.../Karabiner-Elements/Karabiner-Elements-0.90.86.dmg

@faurehu
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How can I use control instead of fn? I'd also like to turn off this feature when using iTerm, is it possible? Thanks.

@viddo
Copy link

@viddo viddo commented on 5531032 Mar 27, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fn + hjkl => arrow keys isn't working for me. I've tried restarting, too. Other ideas of what to try/troubleshoot?

I'm using Mac OSX Sierra v10.12.4 and Karabiner-Elements v0.90.92

@jhegedus42
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a solution with lua : Hammerspoon/hammerspoon#1252 (comment)

@schuchard
Copy link

@schuchard schuchard commented on 5531032 Apr 4, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm unable to get the build to run with the changes above. Without them it works. Boost is installed, running OSX 10.12.4.

Any idea's on a workaround?

My output with the changes applied:

➔ make
git clean -f -x -d
Removing .DS_Store
Removing opt/
Removing pkginfo/Distribution.xml
Removing src/apps/EventViewer/Info.plist
Removing src/apps/EventViewer/build/
Removing src/apps/PreferencesWindow/PreferencesWindow/Info.plist
Removing src/apps/PreferencesWindow/build/
Removing src/apps/Updater/Updater/Info.plist
Removing src/apps/Updater/build/
Removing src/apps/lib/libkrbn/build/
Removing src/core/console_user_server/build/
Removing src/core/event_dispatcher/build/
Removing src/core/grabber/build/
Removing src/share/karabiner_version.h
Removing src/vendor/Karabiner-VirtualHIDDevice/src/VirtualHIDManager/Info.plist
./make-package.sh
make build
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
......................................................................
..
The following commands produced analyzer issues:
	AnalyzeShallow main.cpp
..(1 command with analyzer issues)
............................................................
The following commands produced analyzer issues:
	AnalyzeShallow main.cpp
(1 command with analyzer issues)
......
....................................** BUILD FAILED **


The following commands produced analyzer issues:
	AnalyzeShallow main.cpp
(1 command with analyzer issues)

The following build commands failed:
	CompileC build/karabiner_grabber.build/Release/karabiner_grabber.build/Objects-normal/x86_64/main.o main.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
make[3]: *** [all] Error 65
make[2]: *** [all] Error 2
make[1]: *** [build] Error 2

make: *** [all] Error 99

EDIT:

The build is working, my adjustments were slightly different that those listed above and I had a typo. Though what helped me was running make build to see a more verbose output and in my case the specific problem. Once fixed the build produced a working .dmg file.

Please sign in to comment.