From 4555bb163e2d5be68a44e21786a513fc33a866a7 Mon Sep 17 00:00:00 2001 From: Sam Wray Date: Sat, 4 May 2024 14:10:46 +0100 Subject: [PATCH] feat(haptics): adds haptics for magic trackpads (#908) --- package.json | 1 + patches/hapticjs+1.0.7.patch | 32 ++++++++++++++++++++++++ src/components/Controls/RangeControl.vue | 12 ++++++++- yarn.lock | 5 ++++ 4 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 patches/hapticjs+1.0.7.patch diff --git a/package.json b/package.json index 8584c2e26..28d4cd5dc 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,7 @@ "fuse.js": "^6.2.1", "golden-layout": "^1.5.9", "grandiose": "github:vcync/grandiose#feat/workerCompatibility", + "hapticjs": "^1.0.7", "interactive-shader-format": "github:vcync/interactive-shader-format-js#78b62b6f4c787b870852df4c8e7b1131e331d8a6", "lodash.get": "^4.4.2", "lodash.set": "^4.3.2", diff --git a/patches/hapticjs+1.0.7.patch b/patches/hapticjs+1.0.7.patch new file mode 100644 index 000000000..ecf7592b7 --- /dev/null +++ b/patches/hapticjs+1.0.7.patch @@ -0,0 +1,32 @@ +diff --git a/node_modules/hapticjs/.DS_Store b/node_modules/hapticjs/.DS_Store +new file mode 100644 +index 0000000..487d1a1 +Binary files /dev/null and b/node_modules/hapticjs/.DS_Store differ +diff --git a/node_modules/hapticjs/app.js b/node_modules/hapticjs/app.js +index 0821d19..1fa9828 100644 +--- a/node_modules/hapticjs/app.js ++++ b/node_modules/hapticjs/app.js +@@ -1,10 +1,10 @@ ++var os = require("os") + var exec = require('child_process').exec + var path = require('path') + var cmd = path.join(__dirname, 'hapticJS', 'DerivedData', 'hapticJS', 'Build', 'Products', 'Release', 'hapticJS') + + exports.vibrate = function() { + if (os.platform().includes('darwin')) { +- console.log('vibrating now...') + exec(cmd, function(error, stdout, stderr) { + // command output is in stdout + }) +diff --git a/node_modules/hapticjs/hapticJS/.DS_Store b/node_modules/hapticjs/hapticJS/.DS_Store +new file mode 100644 +index 0000000..57ae955 +Binary files /dev/null and b/node_modules/hapticjs/hapticJS/.DS_Store differ +diff --git a/node_modules/hapticjs/hapticJS/DerivedData/.DS_Store b/node_modules/hapticjs/hapticJS/DerivedData/.DS_Store +new file mode 100644 +index 0000000..487d1a1 +Binary files /dev/null and b/node_modules/hapticjs/hapticJS/DerivedData/.DS_Store differ +diff --git a/node_modules/hapticjs/hapticJS/DerivedData/hapticJS/.DS_Store b/node_modules/hapticjs/hapticJS/DerivedData/hapticJS/.DS_Store +new file mode 100644 +index 0000000..9d704a3 +Binary files /dev/null and b/node_modules/hapticjs/hapticJS/DerivedData/hapticJS/.DS_Store differ diff --git a/src/components/Controls/RangeControl.vue b/src/components/Controls/RangeControl.vue index 2e1584afa..0f83832eb 100644 --- a/src/components/Controls/RangeControl.vue +++ b/src/components/Controls/RangeControl.vue @@ -16,6 +16,8 @@