Repository navigation
feat(input): haptic.h - a force-feedback motor over evdev - #117
Merged
Merged
Conversation
One pulse of a length and a strength, re-uploaded in place on one effect: FF_RUMBLE where the device has it, else an FF_PERIODIC sine. A phone's haptic actuator and a gamepad's rumble both speak this. Found by capability under /dev/input; off Linux every open refuses. On Linux as root the test makes a uinput motor, has a child pulse it, and answers the kernel's upload. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VUf1KjpFGzyMfmDMRwey24
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
inkcell/ui/haptic.h: a force-feedback motor on an evdev node, the output side of the input devices inkcell already reads. A phone's haptic actuator and a gamepad's rumble both appear this way on Linux. inkos's audio service uses it for touch feedback and alarms (inkos roadmap R2).inkcell_haptic_pulse(h, ms, strength)re-uploads one effect in place (EVIOCSFFwith its id) and plays it with anEV_FFevent, replacing whatever was playing. A pattern is the caller's timer stepping through pulses. One effect, updated in place, is what every driver supports; a bank of effects is not.FF_RUMBLEwhere the device has it, otherwise anFF_PERIODICsine. A node with neither refuses with-ENOTSUP.inkcell_haptic_find(dir): the firstevent*node under a directory that has a motor.inkcell_haptic_magnitude(): percent to the 16-bit magnitude, squared. Pure, tested everywhere.-ENOSYS, as the KMS backend does. Request codes go through inkwell'sbase/ioctl.h.Tests (
tests/suites/ui_haptic.c):-ENOSYSoff Linux);FF_RUMBLE, forks a child that finds it by capability and pulses it, answers the kernel'sUI_FF_UPLOAD, and checks a 30 ms / 60 % rumble was uploaded and played. Without root or/dev/uinputit says it skipped.Verified:
make testandmake format-checkon macOS. In alpine under--privileged, all 439 tests pass, with the uinput round trip running for real.🤖 Generated with Claude Code
https://claude.ai/code/session_01VUf1KjpFGzyMfmDMRwey24