Giter Site home page Giter Site logo

niw / haptickey Goto Github PK

View Code? Open in Web Editor NEW
1.6K 35.0 61.0 6.49 MB

A simple utility application to trigger haptic feedback when tapping Touch Bar.

License: MIT License

Objective-C 93.77% Makefile 2.37% Ruby 0.07% Shell 3.79%
macos touchbar objective-c

haptickey's Introduction

HapticKey

HapticKey is a simple utility application for MacBook with Touch Bar that triggers a haptic feedback when tapping Touch Bar.

HapticKey

Since Touch Bar is just a flat panel, there is no feedback other than a visual change of the key displayed, it is terribly uncomfortable especially when tapping ESC key, like while using Vim.

By adding a haptic feedback, which is vibrating a trackpad not Touch Bar itself, it helps to improve the usage of Touch Bar. It is also optionally playing a sound effect or flashing the screen like a visual bell on a terminal.

Usage

Download the latest pre-built application binary from Releases page. Note that these pre-built application binaries are not signed so you need to allow to execute it on Security & Privacy settings pane in System Preferences.

Also, the application may ask a permission to use Accessibility, as like the other applications that are listening system events.

Build

To build the application from the source code, you need to use the latest version of Xcode.

Simply use make to install all dependencies, build application binary, then archive it in build/HapticKey.xcarchive/Products/.

$ make

Development

You can simply open HapticKey.xcodeproj to start development of the application.

Overviews

This application is using CGEventTap to listen key down and up or tap events on Touch Bar.

It triggers haptic feedbacks by using private APIs in MultitouchSupport.framework when the event meets the conditions.

Currently, the application is listening either ESC and F1, F2, etc. keys or tap events on Touch Bar. You can implement your own HTKEventListener to extend the application to trigger feedbacks on arbitrary events.

haptickey's People

Contributors

1024jp avatar heshiyou avatar hyeongminkim avatar jcabak avatar niw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

haptickey's Issues

Better screen feedback instead of flashing screen

Since flashing screen is a little bit aggressive or confusing because it used for alerting in terms of Accessibility feature on macOS.
Possible solution could be

  • Displaying a tapped key name in HUD style
  • Shows a indicator around the mouse cursor or text cursor (if exists.)

Haptic feedback only on touch-down event?

I'm curious if you've tried only doing the feedback on touch-down only, and not on touch-up.

If I touch the key fast enough I only seem to get the touch-down feedback, which makes the response feel inconsistent sometimes. Then I started wondering what it felt like if was possible to only send one haptic event instead of two.

HapticKey does not Start on Login

Hi and thank for the HapticKey, it is amazing!

With Macbook Pro (2,4 GHz 8-Core Intel Core i9 - Ventura 13.1) HapticKey does not Start on Login (even if I select the option, it could not be selected)

Could you help please?

Always disabled (2018 MBP, 10.13.6)

The new version 0.4.6 remains disabled in 10.13.6 on a 2018 MBP. Clicking on "ESC…" and "All Taps" doesn't enable. Tried deleting preferences; no change. Note: also have BetterTouchTool installed; maybe that's interfering? (But it didn't with the previous version.)

No haptic feedback on MacBook Pro 2018

Hi,

For some reason, there is no haptic feedback on MacBook Pro (tested on the 15" version).

HapticKey correctly detects key strokes, as visual and sound notifications work as expected, but there is no haptic feedback no matter what the intensity is.

Is there anything I could provide in order to diagnose this issue?

System asks permission for Accessibility in Privacy settings again after updating the application

When updating the application using “Check for updates…” menu (by using Sparkle,) after updating the application binary, system asks permission for Accessibility in Privacy settings again, even if it’s previously approved and the application appears in the list with a checkmark.

For short-term solution, to workaround this behavior, toggle the checkmark and enable HapticKey again from the menu item.

Does not work in: Spotlight search field

No feedback happens when the "esc" on the touchbar is pressed while the Spotlight search field is open.
Attempted with vibrate + screen flash enabled.

Mac High Sierra 10.13.4

Haptics don't work with MacOS Monterey

Hi,
I have been using HapticKey perfectly on my 2020 M1 Macbook Pro running Big Sur, but I just upgraded to Monterey today and the haptics are no longer working. The app installs fine, and the screen flash seems to work, but the haptics no longer do. This seems to be an issue with Monterey, because it stopped working as soon as I upgraded. I am using the latest pre-built binary on the github releases page. Any help would be appreciated, thanks.

Trigger feedback while dragging sliders (volume, brightness, etc)

Similar to how the taptic engine on iOS gives you rapid feedback when scrolling through picker values, or jumping through tableview indexes, it would be nice if there was velocity-relative feedback when changing sliders values in the touchbar, for example volume and brightness. I guess just having a set number of clicks per length of slider and triggering events as you pass through them would work pretty well.

This project is great by the way, I had an idea to do this a while ago, so it was a good surprise today to see that it's possible! I'm really confused as to why Apple didn't include some sort of haptic feedback unit in the touchbar from the initial iteration. It probably would have made heavy vim users a little less upset with the removal of the hardware esc key. :)

Not Installing M1 Macbook Pro

“HapticKey” can’t be opened because Apple cannot check it for malicious software.
This software needs to be updated. Contact the developer for more information.

I get this pop up when I open the app after I downloaded the latest version.

'ESC and F1, F2, etc. Keys' haptic setting doesn't do anything

Steps to replicate:

  • Run HapticKey
  • From Menu Bar, change the HapticKey setting to 'All Taps on Touch Bar'
  • Haptic feedback happens correctly for all Touch Bar keys
  • From Menu Bar, change the HapticKey setting to 'ESC and F1, F2, etc. Keys'
  • Press fn to show F-keys -> no haptic feedback

My settings:

image

My system:

HapticKey Version 0.5.0 (16, 23. Mar 2020 at 7.53, 0c50474)
macOS Big Sur 11.0.1 (The issue occured with the latest Catalina as well)
2019 16" MacBook Pro

Haptic Key macOS 11.1 compatibility

I have attempted to install Haptic Key v0.5 on macOS 11.1 without success. I am greeted by a dialog box that states the developer must update the app for installation to proceed. Is there a workaround for Big Sur compatibility or must we await a new version?

Need a stronger haptic feedback

A stronger haptic feedback is always more satisfying, maybe a new haptic option like "powerful". Btw, the "powerful" setting can use the feedback of force-clicking the trackpad. It'll be great if you add it!

Release a new version?

As #42 #43 have been merged, and M1 devices has been released for months. I think it's a good idea to release a version with those fixes?

It seems that the app uses much more memory with trackpad events.

Just found this issue after using it for a couple of hours, the app used almost 400MB memory which ... reminds me the SourceKitService (😛 just kidding, it is doing great now)

So I dig into the code and found that the issue occurs only with trackpad events, when using a mouse the usage is around 10MB which seems to be normal.

This project is so cool by the way 🚀, thanks!

Why no feedback on volume, brightness up / down

I'm getting no feedback when pressing up / down on the volume and screen brightness. Just wondered if I am missing anything or there is a reason why it was excluded? (keyboard setting "Expanded control strip"

Does this work on M1 and Monterey?

You need to use newer binary not released yet for now, but you can use HapticKey.app-cd221bc.zip for testing.
Sorry for inconvenience. See #42 for the details.

Hey, I installed the version from your reply on M1 on Beta 1 Monterey sound effect works but no haptics any updates?

Add custom sound effect menu items.

I'm imagining a submenu for Sound, offering different choices for finger up / down, and toggling one or both off independently. The "Add Sound..." item could just open a Finder window to ~/Library/Application Support/HapticKey/Sounds/ and allow the user to drop custom sound files in that folder.

screen shot 2018-01-29 at 9 13 59 pm

Is this something you'd consider merging? Interested in your feedback.

Fix Chinese translations

Since some of words, probably both in simplified and traditional Chinese translations, have direct translations from English words which are not natural as Chinese expressions.
For example, ”没有” for “None” used in a selection of intensity of haptic feedback.

Current, as of 0.4.2 release, translations are here.

Build issue

When attempting to build an error occurs:

Baryon:HapticKey alan$ make bootstrap
scripts/pod install
/Users/alan/src/HapticKey/scripts/exec_with_gems: line 54: /Users/alan/src/HapticKey/.gems/bin/bundle: No such file or directory
Update gems dependencies...
/Users/alan/src/HapticKey/scripts/exec_with_gems: line 58: /Users/alan/src/HapticKey/.gems/bin/bundle: No such file or directory
Fail to bundle install.
make: *** [Pods/Manifest.lock] Error 1

Missing dependencies?

I'm trying to build after cloning the repo -- I've got Xcode 11.3.1. However, when I try to make, I get:

$ make
scripts/pod install
scripts/pod: line 5: /Users/jhf/stuff/HapticKey/scripts
/Users/jhf/stuff/HapticKey/scripts/exec_with_gems: No such file or directory
scripts/pod: line 5: exec: /Users/jhf/stuff/HapticKey/scripts
/Users/jhf/stuff/HapticKey/scripts/exec_with_gems: cannot execute: No such file or directory
make: *** [Pods/Manifest.lock] Error 126

Is there some other dependency that I'm missing?

Doesn't work with Magic Trackpad 2?

Hi, so when I tap the touch bar, I feel a vibration on the built-in trackpad, but not on the external Magic Trackpad 2, which also has haptic support. Is it possible for this app to use both, or have an option to choose which one vibrates?

Additional option for when to trigger haptic feedback

Currently there are 2 options to trigger haptic feedback;

  1. All Taps on Touch Bar
  2. Esc and F1, F2, etc. keys

The first Isn't ideal as it means you get fedback when you tap the bar even if there's no button there

The second Is quite limiting, as app-specific Touch Bar buttons do not trigger the haptics

Is it possible to add an option for Taps on any Touch Bar buttons?

This would trigger haptics whenever the user touches a button on the touch bar, but not when they tap an empty area of the bar.

Does this work on a M1 Mac?

I downloaded Haptic Keys on my M1 MacBook Pro and the app runs, but no haptics. I don't know what could be wrong.

Special configuration for Terminal?

I've got HapticKey running, configured, and enabled. It successfully vibrates the trackpad when I touch the esc on the trackpad when using, for example, Safari or the Finder.

However, I don't get any sort of response when I hit esc while using Terminal.

Is there something I need to configure to enable use with certain applications?

Possible to limit area where haptics activate?

Hi! I recently found this and was very impressed at the app's functionality. I'm trying to get this to work in tandem with my fork of a touchbar widget app (EnergyBar). I was wondering where in the code I can edit to recompile such that only certain areas of the touchbar will trigger haptics?

Relatively high CPU usage (1-2% during every mouse event)

Every mouse event causes the EventTapCallback to be called, which over time results in a constant 1-2% CPU usage.

I did a basic time profile and found that the main culprit is calling [NSEvent eventWithCGEvent:eventRef], which seems extremely slow for something that I assumed would be "toll-free". There are a few things I'm going to try to reduce CPU usage in the callback, but I was wondering if you had a preferred approach.

screen shot 2018-02-17 at 11 25 04 am

Can it cause damage to Haptic Engine?

First things first, superb app. Feels like this is the way Mac should be shipped by default. However, it makes me question why did apple engineers decide against it? Is it due to the concerns of overuse of haptic engine?

Can HapticKey cause any long term damage to the haptic engine? The utilisation of Haptic Engine is doubled than the intended design. Ik sounds silly and dumb but it might be a concern to many people. Once again thank you for the great application.

Haptic feedback is weak on MacBook Pro 2018.

While debugging the application on MacBook Pro 2018 (#23), there are reports that haptic feedback is weaker on MacBook Pro 2018.
Need to investigate how it’s weak and what solutions can be taken.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.