Forum > macOS / Mac OS X
NSHapticFeedbackPerformer
(1/1)
msintle:
Does anyone have examples of using this with Lazarus for macOS?
Hansaplast:
I have no experience with this, but these macOS 11 headers on Github for Lazarus may be helpful.
You'll find this under "AppKit".
I have not (yet) tested these files, just bumped into them while looking for something else. :)
I am trying to find some time to play with these, but am not quite sure how to use these permanently under Lazarus.
Maybe something that can be added to the Lazarus distribution?
msintle:
I've got a "job bounty" here for anyone interested:
https://www.upwork.com/jobs/~021864320415816148444
msintle:
I've tried the following code, hallucinated by AI of course:
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---var Performer: NSHapticFeedbackPerformerProtocol;begin // Get the default haptic feedback performer Performer := NSHapticFeedbackManager.defaultPerformer; // Perform multiple feedback patterns if Assigned(Performer) then begin // Try different patterns Performer.performFeedbackPattern_performanceTime( NSHapticFeedbackPatternLevelChange, NSHapticFeedbackPerformanceTimeNow ); // Optional: Add a slight delay and try another pattern //Sleep(100); Performer.performFeedbackPattern_performanceTime( NSHapticFeedbackPatternAlignment, NSHapticFeedbackPerformanceTimeNow ); // Optional: Add a slight delay and try another pattern //Sleep(100); Performer.performFeedbackPattern_performanceTime( NSHapticFeedbackPatternGeneric, NSHapticFeedbackPerformanceTimeDefault ); end;end; Sadly it doesn't work. No crashes or anything, but nothing happens.
msintle:
Triggering this code from a timer actually seems to work (say an interval of 100 msec), but it needs your finger to be on the touchpad (I guess the other scenario works too, but is hardly detectable when you're actually tapping the pad).
There's an app which does it without needing to have your finger there, it's called "Haptic Touch Bar".
Any thoughts how that might be possible?
Navigation
[0] Message Index