profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/latenitefilms/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
Chris Hocking latenitefilms LateNite Films Australia https://latenitefilms.com Filmmaker (and occasional coder) @ LateNite Films

latenitefilms/hammerspoon 0

Staggeringly powerful OS X desktop automation with Lua

latenitefilms/hammerspoon_asm 0

Hammerspoon modules in progress...

latenitefilms/hammerspoon_asm.undocumented 0

Hammerspoon and Mjolnir modules utilizing undocumented APIs

latenitefilms/luafilesystem 0

LuaFileSystem is a Lua library developed to complement the set of functions related to file systems offered by the standard Lua distribution.

latenitefilms/Spoons 0

The official repository of Spoon plugins

latenitefilms/WebViewJavascriptBridge 0

An iOS/OSX bridge for sending messages between Obj-C and JavaScript in UIWebViews/WebViews

push eventlatenitefilms/hammerspoon

Chris Hocking

commit sha d710dd293c44ac99470e4805133fd30e4bc079c7

Improvements - Cleaned up code and re-organised things. - Still very much a work-in-progress.

view details

push time in a day

issue openedCommandPost/CommandPost

Bug - Can't set speed to -50%

Prawit Sarathamwuthikul writes:

can’t set speed to -50%

Error Log:

CommandPost v1.2.8 (Build: 6937)

Build Date:                     Jun 11 2021, 22:45:39
macOS Version:                  11.4.0
CommandPost Locale:             en_TH
Current Keyboard Layout:        U.S.
Final Cut Pro Path:             /Applications/Final Cut Pro.app
Final Cut Pro Version:          10.5.2
Final Cut Pro Language:         en
Developer Mode:                 false

2021-07-30 11:48:29: 2021-07-30 11:48:27: -- Loading /Users/voeten/Applications/CommandPost.app/Contents/Resources/extensions/cp/init.lua
2021-07-30 11:48:29: 11:48:29         cp:     Loading Plugins...
2021-07-30 11:48:35: 11:48:35 ** Warning:   plugins: Slow Plugin: core.midi.manager (3.5247349739075)
2021-07-30 11:48:35: 11:48:35 ** Warning:   plugins: Slow Plugin: finalcutpro.midi.controls.controlui.absolute (3.5296199321747)
2021-07-30 11:48:40: 11:48:40 ** Warning:   plugins: Slow Plugin: finalcutpro.setup.scan (4.5774338245392)
2021-07-30 11:48:42: 11:48:42 ** Warning:   plugins: Slow Plugin: core.loupedeckctandlive.manager (1.1760330200195)
2021-07-30 11:48:42: 11:48:42 ** Warning:   plugins: Slow Plugin: core.menu.menuaction (1.8336930274963)
2021-07-30 11:48:45: 11:48:45 ** Warning:   plugins: Slow Plugin (Post): core.menu.menuaction (2.3291370868683)
2021-07-30 11:48:45:                  cp:     Plugins Loaded.
2021-07-30 11:48:45:                          Startup Time: 12.854211 seconds
2021-07-30 11:48:45:                          Garbage Collection Mode: generational
2021-07-30 11:48:45: -- Done.
2021-07-30 11:51:18: 11:51:18 ERROR:    dialog: Error Message Displayed: ...xtensions/cp/apple/finalcutpro/timeline/SpeedPopover.lua:178: method 'checked' is not callable (a nil value)
stack traceback:
	...xtensions/cp/apple/finalcutpro/timeline/SpeedPopover.lua:178: in upvalue 'getFn'
	...dPost.app/Contents/Resources/extensions/cp/prop/init.lua:993: in field '_get'
	...dPost.app/Contents/Resources/extensions/cp/prop/init.lua:509: in function <...dPost.app/Contents/Resources/extensions/cp/prop/init.lua:506>
	(...tail calls...)
	...st.app/Contents/Resources/extensions/cp/ui/TextField.lua:76: in upvalue 'setFn'
	...dPost.app/Contents/Resources/extensions/cp/prop/init.lua:999: in field '_set'
	...dPost.app/Contents/Resources/extensions/cp/prop/init.lua:537: in function <...dPost.app/Contents/Resources/extensions/cp/prop/init.lua:524>
	(...tail calls...)
	...ontents/Resources/plugins/finalcutpro/timeline/speed.lua:43: in upvalue 'thing'
	...app/Contents/Resources/extensions/cp/rx/go/Statement.lua:131: in upvalue 'fn'
	...t.app/Contents/Resources/extensions/cp/rx/Observable.lua:267: in method 'subscribe'
	...t.app/Contents/Resources/extensions/cp/rx/Observable.lua:3128: in function <...t.app/Contents/Resources/extensions/cp/rx/Observable.lua:3047>
	(...tail calls...)
	...t.app/Contents/Resources/extensions/cp/rx/Observable.lua:1553: in field '_onNext'
	...ost.app/Contents/Resources/extensions/cp/rx/Observer.lua:60: in function 'cp.rx.Observer.onNext'
	(...tail calls...)
	...andPost.app/Contents/Resources/extensions/cp/rx/util.lua:21: in function <...andPost.app/Contents/Resources/extensions/cp/rx/util.lua:21>
	[C]: in function 'xpcall'
	...andPost.app/Contents/Resources/extensions/cp/rx/util.lua:21: in function 'cp.rx.util.tryWithObserver'
	...t.app/Contents/Resources/extensions/cp/rx/Observable.lua:1653: in field '_onNext'
	...ost.app/Contents/Resources/extensions/cp/rx/Observer.lua:60: in function 'cp.rx.Observer.onNext'
	...t.app/Contents/Resources/extensions/cp/rx/Observable.lua:1529: in field '_onNext'
	...ost.app/Contents/Resources/extensions/cp/rx/Observer.lua:60: in function 'cp.rx.Observer.onNext'
	...t.app/Contents/Resources/extensions/cp/rx/Observable.lua:3097: in field '_onNext'
	...ost.app/Contents/Resources/extensions/cp/rx/Observer.lua:60: in function 'cp.rx.Observer.onNext'
	...t.app/Contents/Resources/extensions/cp/rx/Observable.lua:984: in function <...t.app/Contents/Resources/extensions/cp/rx/Observable.lua:983>
2021-07-30 11:52:42: 11:52:42 ERROR:    dialog: Error Message Displayed: ...xtensions/cp/apple/finalcutpro/timeline/SpeedPopover.lua:178: method 'checked' is not callable (a nil value)
stack traceback:
	...xtensions/cp/apple/finalcutpro/timeline/SpeedPopover.lua:178: in upvalue 'getFn'
	...dPost.app/Contents/Resources/extensions/cp/prop/init.lua:993: in field '_get'
	...dPost.app/Contents/Resources/extensions/cp/prop/init.lua:509: in function <...dPost.app/Contents/Resources/extensions/cp/prop/init.lua:506>
	(...tail calls...)
	...st.app/Contents/Resources/extensions/cp/ui/TextField.lua:76: in upvalue 'setFn'
	...dPost.app/Contents/Resources/extensions/cp/prop/init.lua:999: in field '_set'
	...dPost.app/Contents/Resources/extensions/cp/prop/init.lua:537: in function <...dPost.app/Contents/Resources/extensions/cp/prop/init.lua:524>
	(...tail calls...)
	...ontents/Resources/plugins/finalcutpro/timeline/speed.lua:43: in upvalue 'thing'
	...app/Contents/Resources/extensions/cp/rx/go/Statement.lua:131: in upvalue 'fn'
	...t.app/Contents/Resources/extensions/cp/rx/Observable.lua:267: in method 'subscribe'
	...t.app/Contents/Resources/extensions/cp/rx/Observable.lua:3128: in function <...t.app/Contents/Resources/extensions/cp/rx/Observable.lua:3047>
	(...tail calls...)
	...t.app/Contents/Resources/extensions/cp/rx/Observable.lua:1553: in field '_onNext'
	...ost.app/Contents/Resources/extensions/cp/rx/Observer.lua:60: in function 'cp.rx.Observer.onNext'
	(...tail calls...)
	...andPost.app/Contents/Resources/extensions/cp/rx/util.lua:21: in function <...andPost.app/Contents/Resources/extensions/cp/rx/util.lua:21>
	[C]: in function 'xpcall'
	...andPost.app/Contents/Resources/extensions/cp/rx/util.lua:21: in function 'cp.rx.util.tryWithObserver'
	...t.app/Contents/Resources/extensions/cp/rx/Observable.lua:1653: in field '_onNext'
	...ost.app/Contents/Resources/extensions/cp/rx/Observer.lua:60: in function 'cp.rx.Observer.onNext'
	...t.app/Contents/Resources/extensions/cp/rx/Observable.lua:1529: in field '_onNext'
	...ost.app/Contents/Resources/extensions/cp/rx/Observer.lua:60: in function 'cp.rx.Observer.onNext'
	...t.app/Contents/Resources/extensions/cp/rx/Observable.lua:3097: in field '_onNext'
	...ost.app/Contents/Resources/extensions/cp/rx/Observer.lua:60: in function 'cp.rx.Observer.onNext'
	...t.app/Contents/Resources/extensions/cp/rx/Observable.lua:984: in function <...t.app/Contents/Resources/extensions/cp/rx/Observable.lua:983>

created time in 2 days

issue commentHammerspoon/hammerspoon

hs.window:move has inconsistent performance

Here are my timings on Mojave:

2021-07-28 09:47:08: 09:47:08       move:     Moved 40 times:
2021-07-28 09:47:08:                            Event 1: time = 0.00639ms, move = 289.06827ms, dx = -13px, dy = -1px
2021-07-28 09:47:08:                            Event 2: time = 289.12867ms, move = 221.39369ms, dx = -13px, dy = -2px
2021-07-28 09:47:08:                            Event 3: time = 510.57154ms, move = 213.86852ms, dx = -9px, dy = -1px
2021-07-28 09:47:08:                            Event 4: time = 724.49567ms, move = 217.86973ms, dx = -3px, dy = -2px
2021-07-28 09:47:08:                            Event 5: time = 942.41116ms, move = 215.66587ms, dx = -13px, dy = -1px
2021-07-28 09:47:08:                            Event 6: time = 1158.13054ms, move = 213.17625ms, dx = -10px, dy = -2px
2021-07-28 09:47:08:                            Event 7: time = 1371.487ms, move = 247.91326ms, dx = -6px, dy = 0px
2021-07-28 09:47:08:                            Event 8: time = 1619.45405ms, move = 232.17482ms, dx = -4px, dy = -2px
2021-07-28 09:47:08:                            Event 9: time = 1851.69536ms, move = 232.41995ms, dx = -4px, dy = 0px
2021-07-28 09:47:08:                            Event 10: time = 2084.17804ms, move = 208.87729ms, dx = -12px, dy = -2px
2021-07-28 09:47:08:                            Event 11: time = 2293.10512ms, move = 228.85383ms, dx = -11px, dy = 0px
2021-07-28 09:47:08:                            Event 12: time = 2522.00946ms, move = 212.17199ms, dx = -11px, dy = 0px
2021-07-28 09:47:08:                            Event 13: time = 2734.23341ms, move = 215.52002ms, dx = -5px, dy = -2px
2021-07-28 09:47:08:                            Event 14: time = 2949.82467ms, move = 223.12076ms, dx = -11px, dy = 0px
2021-07-28 09:47:08:                            Event 15: time = 3172.99838ms, move = 219.55235ms, dx = -12px, dy = 0px
2021-07-28 09:47:08:                            Event 16: time = 3392.60229ms, move = 217.69837ms, dx = -5px, dy = 0px
2021-07-28 09:47:08:                            Event 17: time = 3610.34863ms, move = 218.85968ms, dx = -5px, dy = -1px
2021-07-28 09:47:08:                            Event 18: time = 3829.31522ms, move = 219.52763ms, dx = -4px, dy = -2px
2021-07-28 09:47:08:                            Event 19: time = 4048.92885ms, move = 239.62706ms, dx = -4px, dy = 0px
2021-07-28 09:47:08:                            Event 20: time = 4288.61392ms, move = 230.48992ms, dx = -15px, dy = 0px
2021-07-28 09:47:08:                            Event 21: time = 4519.15366ms, move = 213.22775ms, dx = -12px, dy = -2px
2021-07-28 09:47:08:                            Event 22: time = 4732.43143ms, move = 210.55814ms, dx = -11px, dy = 0px
2021-07-28 09:47:08:                            Event 23: time = 4943.03644ms, move = 232.10514ms, dx = -15px, dy = 0px
2021-07-28 09:47:08:                            Event 24: time = 5175.18766ms, move = 235.13491ms, dx = -9px, dy = -1px
2021-07-28 09:47:08:                            Event 25: time = 5410.37728ms, move = 233.33577ms, dx = -4px, dy = -1px
2021-07-28 09:47:08:                            Event 26: time = 5643.77351ms, move = 233.65875ms, dx = -15px, dy = -2px
2021-07-28 09:47:08:                            Event 27: time = 5877.48584ms, move = 217.5153ms, dx = -3px, dy = 0px
2021-07-28 09:47:08:                            Event 28: time = 6095.05892ms, move = 219.98165ms, dx = -2px, dy = -1px
2021-07-28 09:47:08:                            Event 29: time = 6315.10176ms, move = 228.99996ms, dx = -5px, dy = -2px
2021-07-28 09:47:08:                            Event 30: time = 6544.15904ms, move = 222.26846ms, dx = -3px, dy = 0px
2021-07-28 09:47:08:                            Event 31: time = 6766.47805ms, move = 223.10728ms, dx = -3px, dy = -2px
2021-07-28 09:47:08:                            Event 32: time = 6989.77435ms, move = 245.06894ms, dx = -8px, dy = -2px
2021-07-28 09:47:08:                            Event 33: time = 7234.89227ms, move = 219.32029ms, dx = -10px, dy = -1px
2021-07-28 09:47:08:                            Event 34: time = 7454.33029ms, move = 226.36979ms, dx = -2px, dy = -1px
2021-07-28 09:47:08:                            Event 35: time = 7680.75848ms, move = 217.10124ms, dx = -12px, dy = -2px
2021-07-28 09:47:08:                            Event 36: time = 7897.90812ms, move = 230.98119ms, dx = -6px, dy = -2px
2021-07-28 09:47:08:                            Event 37: time = 8128.94019ms, move = 229.46816ms, dx = -8px, dy = 0px
2021-07-28 09:47:08:                            Event 38: time = 8358.50509ms, move = 234.80294ms, dx = -9px, dy = 0px
2021-07-28 09:47:08:                            Event 39: time = 8593.36874ms, move = 215.19098ms, dx = -13px, dy = -2px
2021-07-28 09:47:08:                            Event 40: time = 8808.6209ms, move = 234.3636ms, dx = -4px, dy = 0px
2021-07-28 09:47:10: 09:47:10                 Moved 40 times:
2021-07-28 09:47:10:                            Event 1: time = 0.00747ms, move = 289.35596ms, dx = -10px, dy = 0px
2021-07-28 09:47:10:                            Event 2: time = 289.43333ms, move = 242.41979ms, dx = -7px, dy = -1px
2021-07-28 09:47:10:                            Event 3: time = 531.94011ms, move = 252.54655ms, dx = -15px, dy = -2px
2021-07-28 09:47:10:                            Event 4: time = 784.547ms, move = 220.81957ms, dx = -2px, dy = -2px
2021-07-28 09:47:10:                            Event 5: time = 1005.41607ms, move = 252.43985ms, dx = -11px, dy = -1px
2021-07-28 09:47:10:                            Event 6: time = 1257.9102ms, move = 223.82918ms, dx = -2px, dy = 0px
2021-07-28 09:47:10:                            Event 7: time = 1481.79511ms, move = 224.30484ms, dx = -5px, dy = -2px
2021-07-28 09:47:10:                            Event 8: time = 1706.15008ms, move = 231.61993ms, dx = -15px, dy = 0px
2021-07-28 09:47:10:                            Event 9: time = 1937.84065ms, move = 263.03137ms, dx = -3px, dy = 0px
2021-07-28 09:47:10:                            Event 10: time = 2200.93525ms, move = 221.97131ms, dx = -10px, dy = -1px
2021-07-28 09:47:10:                            Event 11: time = 2422.96278ms, move = 220.54927ms, dx = -10px, dy = -1px
2021-07-28 09:47:10:                            Event 12: time = 2643.5659ms, move = 228.21335ms, dx = -13px, dy = -2px
2021-07-28 09:47:10:                            Event 13: time = 2871.85412ms, move = 253.6188ms, dx = -2px, dy = -1px
2021-07-28 09:47:10:                            Event 14: time = 3125.52844ms, move = 228.2709ms, dx = -14px, dy = 0px
2021-07-28 09:47:10:                            Event 15: time = 3353.85192ms, move = 233.11983ms, dx = -12px, dy = -1px
2021-07-28 09:47:10:                            Event 16: time = 3587.02435ms, move = 223.10401ms, dx = -9px, dy = -2px
2021-07-28 09:47:10:                            Event 17: time = 3810.18363ms, move = 229.75225ms, dx = -8px, dy = 0px
2021-07-28 09:47:10:                            Event 18: time = 4039.99673ms, move = 225.74641ms, dx = -9px, dy = 0px
2021-07-28 09:47:10:                            Event 19: time = 4265.7942ms, move = 210.83807ms, dx = -4px, dy = -1px
2021-07-28 09:47:10:                            Event 20: time = 4476.68141ms, move = 235.30202ms, dx = -6px, dy = -1px
2021-07-28 09:47:10:                            Event 21: time = 4712.03372ms, move = 220.63805ms, dx = -6px, dy = 0px
2021-07-28 09:47:10:                            Event 22: time = 4932.72348ms, move = 220.13716ms, dx = -13px, dy = 0px
2021-07-28 09:47:10:                            Event 23: time = 5152.91491ms, move = 220.6848ms, dx = -13px, dy = 0px
2021-07-28 09:47:10:                            Event 24: time = 5373.77661ms, move = 215.29245ms, dx = -4px, dy = -1px
2021-07-28 09:47:10:                            Event 25: time = 5589.11801ms, move = 219.70286ms, dx = -14px, dy = 0px
2021-07-28 09:47:10:                            Event 26: time = 5808.87383ms, move = 229.2655ms, dx = -13px, dy = 0px
2021-07-28 09:47:10:                            Event 27: time = 6038.19404ms, move = 220.72476ms, dx = -10px, dy = 0px
2021-07-28 09:47:10:                            Event 28: time = 6258.971ms, move = 217.08687ms, dx = -9px, dy = -2px
2021-07-28 09:47:10:                            Event 29: time = 6476.10662ms, move = 221.83928ms, dx = -11px, dy = -1px
2021-07-28 09:47:10:                            Event 30: time = 6698.00209ms, move = 225.3444ms, dx = -8px, dy = -1px
2021-07-28 09:47:10:                            Event 31: time = 6923.39784ms, move = 222.44674ms, dx = -5px, dy = 0px
2021-07-28 09:47:10:                            Event 32: time = 7145.89783ms, move = 226.61602ms, dx = -15px, dy = -1px
2021-07-28 09:47:10:                            Event 33: time = 7372.56395ms, move = 207.38373ms, dx = -15px, dy = 0px
2021-07-28 09:47:10:                            Event 34: time = 7580.00905ms, move = 238.40863ms, dx = -2px, dy = 0px
2021-07-28 09:47:10:                            Event 35: time = 7818.4686ms, move = 224.48387ms, dx = -15px, dy = -1px
2021-07-28 09:47:10:                            Event 36: time = 8043.00245ms, move = 220.302ms, dx = -13px, dy = -1px
2021-07-28 09:47:10:                            Event 37: time = 8263.35333ms, move = 224.79878ms, dx = -11px, dy = -1px
2021-07-28 09:47:10:                            Event 38: time = 8488.20657ms, move = 223.61744ms, dx = -2px, dy = 0px
2021-07-28 09:47:10:                            Event 39: time = 8711.87539ms, move = 218.31523ms, dx = -4px, dy = -2px
2021-07-28 09:47:10:                            Event 40: time = 8930.23656ms, move = 211.98826ms, dx = -11px, dy = -1px
2021-07-28 09:47:19: 09:47:19                 Moved 40 times:
2021-07-28 09:47:19:                            Event 1: time = 0.00846ms, move = 313.33413ms, dx = -11px, dy = 0px
2021-07-28 09:47:19:                            Event 2: time = 313.4038ms, move = 263.14754ms, dx = -11px, dy = -1px
2021-07-28 09:47:19:                            Event 3: time = 576.60965ms, move = 263.61298ms, dx = -5px, dy = 0px
2021-07-28 09:47:19:                            Event 4: time = 840.28349ms, move = 228.71494ms, dx = -3px, dy = 0px
2021-07-28 09:47:19:                            Event 5: time = 1069.04929ms, move = 221.33861ms, dx = -13px, dy = -2px
2021-07-28 09:47:19:                            Event 6: time = 1290.44822ms, move = 226.10811ms, dx = -15px, dy = -1px
2021-07-28 09:47:19:                            Event 7: time = 1516.60331ms, move = 235.34187ms, dx = -11px, dy = -2px
2021-07-28 09:47:19:                            Event 8: time = 1752.006ms, move = 243.2776ms, dx = -14px, dy = -2px
2021-07-28 09:47:19:                            Event 9: time = 1995.3485ms, move = 223.16502ms, dx = -4px, dy = -1px
2021-07-28 09:47:19:                            Event 10: time = 2218.57207ms, move = 226.54254ms, dx = -15px, dy = -1px
2021-07-28 09:47:19:                            Event 11: time = 2445.16629ms, move = 223.30873ms, dx = -15px, dy = -1px
2021-07-28 09:47:19:                            Event 12: time = 2668.54271ms, move = 275.51899ms, dx = -4px, dy = 0px
2021-07-28 09:47:19:                            Event 13: time = 2944.13677ms, move = 246.41128ms, dx = -11px, dy = 0px
2021-07-28 09:47:19:                            Event 14: time = 3190.60376ms, move = 228.20355ms, dx = -10px, dy = -1px
2021-07-28 09:47:19:                            Event 15: time = 3418.86079ms, move = 225.07908ms, dx = -11px, dy = -1px
2021-07-28 09:47:19:                            Event 16: time = 3643.99539ms, move = 232.40275ms, dx = -2px, dy = -2px
2021-07-28 09:47:19:                            Event 17: time = 3876.45229ms, move = 244.82075ms, dx = -2px, dy = 0px
2021-07-28 09:47:19:                            Event 18: time = 4121.33013ms, move = 223.66132ms, dx = -13px, dy = -1px
2021-07-28 09:47:19:                            Event 19: time = 4345.04772ms, move = 217.77078ms, dx = -8px, dy = 0px
2021-07-28 09:47:19:                            Event 20: time = 4562.87419ms, move = 243.43412ms, dx = -5px, dy = -2px
2021-07-28 09:47:19:                            Event 21: time = 4806.36023ms, move = 245.70928ms, dx = -6px, dy = 0px
2021-07-28 09:47:19:                            Event 22: time = 5052.11893ms, move = 222.79434ms, dx = -5px, dy = -2px
2021-07-28 09:47:19:                            Event 23: time = 5274.96123ms, move = 209.10929ms, dx = -7px, dy = 0px
2021-07-28 09:47:19:                            Event 24: time = 5484.11953ms, move = 231.71987ms, dx = -4px, dy = -2px
2021-07-28 09:47:19:                            Event 25: time = 5715.90584ms, move = 251.67009ms, dx = -7px, dy = -1px
2021-07-28 09:47:19:                            Event 26: time = 5967.63347ms, move = 224.70183ms, dx = -15px, dy = -2px
2021-07-28 09:47:19:                            Event 27: time = 6192.38753ms, move = 230.10053ms, dx = -2px, dy = -1px
2021-07-28 09:47:19:                            Event 28: time = 6422.54393ms, move = 230.35219ms, dx = -9px, dy = -2px
2021-07-28 09:47:19:                            Event 29: time = 6652.95097ms, move = 232.52577ms, dx = -8px, dy = -1px
2021-07-28 09:47:19:                            Event 30: time = 6885.53165ms, move = 221.40702ms, dx = -14px, dy = -2px
2021-07-28 09:47:19:                            Event 31: time = 7106.99546ms, move = 214.77397ms, dx = -7px, dy = -2px
2021-07-28 09:47:19:                            Event 32: time = 7321.81654ms, move = 209.9966ms, dx = -4px, dy = -1px
2021-07-28 09:47:19:                            Event 33: time = 7531.85794ms, move = 222.81139ms, dx = -4px, dy = -1px
2021-07-28 09:47:19:                            Event 34: time = 7754.7328ms, move = 226.35008ms, dx = -2px, dy = 0px
2021-07-28 09:47:19:                            Event 35: time = 7981.13387ms, move = 225.96184ms, dx = -13px, dy = -2px
2021-07-28 09:47:19:                            Event 36: time = 8207.14583ms, move = 238.60895ms, dx = -9px, dy = 0px
2021-07-28 09:47:19:                            Event 37: time = 8445.80551ms, move = 224.12434ms, dx = -15px, dy = 0px
2021-07-28 09:47:19:                            Event 38: time = 8669.99491ms, move = 254.3866ms, dx = -11px, dy = 0px
2021-07-28 09:47:19:                            Event 39: time = 8924.4325ms, move = 225.42133ms, dx = -13px, dy = -2px
2021-07-28 09:47:19:                            Event 40: time = 9149.90468ms, move = 244.79227ms, dx = -14px, dy = -2px
dbalatero

comment created time in 4 days

issue openedCommandPost/CommandPost

Add basic audio control to Monogram

Drew Boyd suggests:

Hi all - please consider my request to work with Command Post to offer robust inputs for the sliders within FCPX (Volume, Effect Mix, etc.) for selected clips.

I purchased the slider panel thinking it would be useful for FCPX audio work, but have found it lacking in the early stage.

Otherwise, great products!

created time in 4 days

push eventlatenitefilms/hammerspoon

Chris Hocking

commit sha c74bf1dad62770c01c5c6fc8997c49a14e11d5b6

Improvements - Added the JSON files from the Razor macOS project. - Added methods to access the JSON data. - Work in progress.

view details

push time in 5 days

issue commentHammerspoon/hammerspoon

hs.razer - Add support for Razer devices

Unfortunately that's above my skillset - but I'm hoping @asmagill might be able to investigate this at some point. I'm HOPING it's possible, based on some of the digging above, but I'm not really sure.

In the meantime, you can use the hidutil Terminal command to remap keyboard keys per device. For example, I'm currently remapping all the Razer Tartarus V2 key to "dummy keys" - which mean they do nothing, then I'm using IOKit to detect the key presses, and then trigger a Lua callback. It's a bit of a hack job, but it works, and doesn't require any privilege escalation or drivers (i.e. Karabiner-Elements).

latenitefilms

comment created time in 5 days

issue commentHammerspoon/hammerspoon

Suggestions for debugging an infrequently hanging Hammerspoon?

Can you share your config and/or the crash report when you force quit it? What version of Hammerspoon and macOS?

von

comment created time in 5 days

issue commentHammerspoon/hammerspoon

hs.razer - Add support for Razer Tartarus V2

I’m actually hoping to support all the Razer devices that OpenRazer already supports - at least in terms of controlling their LEDs. At this stage in terms of having a callback for button presses, I’m only working on the Razer Tartarus V2, but that could be extended fairly easily by others if they have the hardware.

In terms of niche devices, we already support Tangent panels, Stream Deck’s, etc.

Ultimately it’s up to @cmsj and @asmagil as to whether or not they merge, but if not - I can just merge directly into CommandPost. It can’t be done as a Spoon, because spoons must be Lua only.

latenitefilms

comment created time in 6 days

push eventlatenitefilms/hammerspoon

Chris Hocking

commit sha 8f734ae5b271b48f6e13d0a3b21ab1259780c015

Improvements - Added an event tap to prevent the scroll wheel from actually scrolling.

view details

push time in 7 days

push eventlatenitefilms/hammerspoon

Chris Hocking

commit sha c67433776589830695fa837206bb8313ec880f8a

Improvements - Added `deviceName` method. - Added garbage collection. - Added example to in-line documentation. - Scroll wheel now correctly reports wheel press and release.

view details

push time in 7 days

PullRequestReviewEvent

Pull request review commentHammerspoon/hammerspoon

hs.razer - Added support for Razer Tartarus V2

+/*+ * This program is free software; you can redistribute it and/or modify+ * it under the terms of the GNU General Public License as published by+ * the Free Software Foundation; either version 2 of the License, or+ * (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the+ * GNU General Public License for more details.+ *+ * You should have received a copy of the GNU General Public License+ * along with this program; if not, write to the Free Software+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA+ *+ * Should you need to contact me, the author, you can do so by+ * e-mail - mail your message to Terry Cain <terry@terrys-home.co.uk>+ */++#include <stdio.h>+#include <stdlib.h>+#include <string.h>+#include <math.h>++#include "razerkbd_driver.h"+#include "razerchromacommon.h"+#include "razercommon.h"++static struct razer_report razer_send_payload(IOUSBDeviceInterface **dev, struct razer_report *request_report);++bool is_blade_laptop(IOUSBDeviceInterface **usb_dev)+{+    UInt16 product = -1;+    (*usb_dev)->GetDeviceProduct(usb_dev, &product);++    switch (product)+    {+    case USB_DEVICE_ID_RAZER_BLADE_STEALTH:+    case USB_DEVICE_ID_RAZER_BLADE_STEALTH_LATE_2016:+    case USB_DEVICE_ID_RAZER_BLADE_PRO_LATE_2016:+    case USB_DEVICE_ID_RAZER_BLADE_2018:+    case USB_DEVICE_ID_RAZER_BLADE_2018_MERCURY:+    case USB_DEVICE_ID_RAZER_BLADE_2018_BASE:+    case USB_DEVICE_ID_RAZER_BLADE_2019_ADV:+    case USB_DEVICE_ID_RAZER_BLADE_MID_2019_MERCURY:+    case USB_DEVICE_ID_RAZER_BLADE_STUDIO_EDITION_2019:+    case USB_DEVICE_ID_RAZER_BLADE_QHD:+    case USB_DEVICE_ID_RAZER_BLADE_LATE_2016:+    case USB_DEVICE_ID_RAZER_BLADE_STEALTH_MID_2017:+    case USB_DEVICE_ID_RAZER_BLADE_STEALTH_LATE_2017:+    case USB_DEVICE_ID_RAZER_BLADE_STEALTH_2019:+    case USB_DEVICE_ID_RAZER_BLADE_PRO_2017:+    case USB_DEVICE_ID_RAZER_BLADE_PRO_2017_FULLHD:+    case USB_DEVICE_ID_RAZER_BLADE_2019_BASE:+    case USB_DEVICE_ID_RAZER_BLADE_STEALTH_LATE_2019:+        return true;+    }++    return false;+}++/**+ * Read device file "game_mode"+ *+ * Returns a string+ */+ssize_t razer_attr_read_mode_game(IOUSBDeviceInterface **usb_dev, char *buf)+{+    struct razer_report report = razer_chroma_standard_get_led_state(VARSTORE, GAME_LED);+    struct razer_report response;++    response = razer_send_payload(usb_dev, &report);+    return sprintf(buf, "%d\n", response.arguments[2]);+}++/**+ * Write device file "mode_macro" + *+ * When 1 is written (as a character, 0x31) Macro mode will be enabled, if 0 is written (0x30)+ * then game mode will be disabled+ */+ssize_t razer_attr_write_mode_macro(IOUSBDeviceInterface **usb_dev, const char *buf, int count)+{+    unsigned char enabled = (unsigned char)strtol(buf, NULL, 10);+    struct razer_report report = razer_chroma_standard_set_led_state(VARSTORE, MACRO_LED, enabled);++    razer_send_payload(usb_dev, &report);++    return count;+}++/**+ * Write device file "mode_macro_effect"+ *+ * When 1 is written the LED will blink, 0 will static+ */+ssize_t razer_attr_write_mode_macro_effect(IOUSBDeviceInterface **usb_dev, const char *buf, int count)+{++    struct razer_report report = {0};+    unsigned char enabled = (unsigned char)strtoul(buf, NULL, 10);++    UInt16 product = -1;+    (*usb_dev)->GetDeviceProduct(usb_dev, &product);++    switch (product)+    {+    case USB_DEVICE_ID_RAZER_BLACKWIDOW_LITE:+    case USB_DEVICE_ID_RAZER_ORNATA:+    case USB_DEVICE_ID_RAZER_ORNATA_CHROMA:+    case USB_DEVICE_ID_RAZER_ORNATA_CHROMA_V2:+    case USB_DEVICE_ID_RAZER_HUNTSMAN_ELITE:+    case USB_DEVICE_ID_RAZER_HUNTSMAN_TE:+    case USB_DEVICE_ID_RAZER_BLACKWIDOW_2019:+    case USB_DEVICE_ID_RAZER_HUNTSMAN:+    case USB_DEVICE_ID_RAZER_BLACKWIDOW_ESSENTIAL:+    case USB_DEVICE_ID_RAZER_CYNOSA_CHROMA:+    case USB_DEVICE_ID_RAZER_CYNOSA_LITE:+    case USB_DEVICE_ID_RAZER_BLACKWIDOW_V3:+    case USB_DEVICE_ID_RAZER_BLACKWIDOW_V3_TK:+    case USB_DEVICE_ID_RAZER_HUNTSMAN_MINI:+        report = razer_chroma_standard_set_led_effect(NOSTORE, MACRO_LED, enabled);+        report.transaction_id.id = 0x3F;+        break;++    case USB_DEVICE_ID_RAZER_TARTARUS_V2:+    case USB_DEVICE_ID_RAZER_BLACKWIDOW_ELITE:+        report = razer_chroma_standard_set_led_effect(NOSTORE, MACRO_LED, enabled);+        report.transaction_id.id = 0x1F;+        break;++    case USB_DEVICE_ID_RAZER_ANANSI:+        report = razer_chroma_standard_set_led_effect(NOSTORE, MACRO_LED, enabled);+        razer_send_payload(usb_dev, &report);++        report = razer_chroma_standard_set_led_blinking(NOSTORE, MACRO_LED);+        break;++    default:+        report = razer_chroma_standard_set_led_effect(VARSTORE, MACRO_LED, enabled);+        break;+    }+    razer_send_payload(usb_dev, &report);++    return count;+}++/**+ * Read device file "macro_mode_effect"+ *+ * Returns a string+ */+ssize_t razer_attr_read_mode_macro_effect(IOUSBDeviceInterface **usb_dev, char *buf)+{+    struct razer_report report = razer_chroma_standard_get_led_effect(VARSTORE, MACRO_LED);+    struct razer_report response = razer_send_payload(usb_dev, &report);++    return sprintf(buf, "%d\n", response.arguments[2]);+}++/**+ * Write device file "mode_pulsate"+ *+ * The brightness oscillates between fully on and fully off generating a pulsing effect+ */+ssize_t razer_attr_write_mode_pulsate(IOUSBDeviceInterface **usb_dev, const char *buf, int count)+{+    struct razer_report report = razer_chroma_standard_set_led_effect(VARSTORE, BACKLIGHT_LED, 0x02);+    razer_send_payload(usb_dev, &report);++    UInt16 product = -1;+    (*usb_dev)->GetDeviceProduct(usb_dev, &product);++    switch (product)+    {+    case USB_DEVICE_ID_RAZER_BLACKWIDOW_STEALTH:+    case USB_DEVICE_ID_RAZER_BLACKWIDOW_STEALTH_EDITION:+    case USB_DEVICE_ID_RAZER_BLACKWIDOW_ULTIMATE_2012:+    case USB_DEVICE_ID_RAZER_BLACKWIDOW_ULTIMATE_2013:+        report = razer_chroma_standard_set_led_effect(VARSTORE, LOGO_LED, 0x02);+        break;+    }++    return count;+}++/**+ * Read device file "mode_pulsate"+ *+ * Returns a string+ */+ssize_t razer_attr_read_mode_pulsate(IOUSBDeviceInterface **usb_dev, char *buf)+{+    struct razer_report report = razer_chroma_standard_get_led_effect(VARSTORE, LOGO_LED);+    struct razer_report response = razer_send_payload(usb_dev, &report);++    return sprintf(buf, "%d\n", response.arguments[2]);+}++/**+ * Read device file "profile_led_red"+ *+ * Actually a Yellow LED+ *+ * Returns a string+ */+ssize_t razer_attr_read_tartarus_profile_led_red(IOUSBDeviceInterface **usb_dev, char *buf)+{+    struct razer_report report = razer_chroma_standard_get_led_state(VARSTORE, RED_PROFILE_LED);+    struct razer_report response = razer_send_payload(usb_dev, &report);++    // CHRIS MODIFIED:+    //return sprintf(buf, "%d\n", response.arguments[2]);+    +    return response.arguments[2];+}++/**+ * Read device file "profile_led_green"+ *+ * Returns a string+ */+ssize_t razer_attr_read_tartarus_profile_led_green(IOUSBDeviceInterface **usb_dev, char *buf)+{+    struct razer_report report = razer_chroma_standard_get_led_state(VARSTORE, GREEN_PROFILE_LED);+    struct razer_report response = razer_send_payload(usb_dev, &report);++    // CHRIS MODIFIED:+    //return sprintf(buf, "%d\n", response.arguments[2]);+    +    return response.arguments[2];+    +}++/**+ * Read device file "profile_led_blue"+ *+ * Returns a string+ */+ssize_t razer_attr_read_tartarus_profile_led_blue(IOUSBDeviceInterface **usb_dev, char *buf)+{+    struct razer_report report = razer_chroma_standard_get_led_state(VARSTORE, BLUE_PROFILE_LED);+    struct razer_report response = razer_send_payload(usb_dev, &report);++    // CHRIS MODIFIED:+    //return sprintf(buf, "%d\n", response.arguments[2]);+    +    return response.arguments[2];+}++/**+ * Read device file "get_firmware_version"+ *+ * Returns a string+ */+ssize_t razer_attr_read_get_firmware_version(IOUSBDeviceInterface **usb_dev, char *buf)+{+    struct razer_report report = razer_chroma_standard_get_firmware_version();+    struct razer_report response_report = razer_send_payload(usb_dev, &report);+    +    // MODIFIED BY CHRIS:+    //return sprintf(buf, "v%d.%d\n", response_report.arguments[0], response_report.arguments[1]);

Ignore me... I implemented a (lazy) workaround.

latenitefilms

comment created time in 7 days

push eventlatenitefilms/hammerspoon

Chris Hocking

commit sha b1a795e350ff1b91dc5f3bfef7e4fd611be1df60

Work in progress - Now functional, but certainly not finished. Needs a lot of cleanup, garbage collection and `deviceCallback`.

view details

push time in 7 days

Pull request review commentHammerspoon/hammerspoon

hs.razer - Added support for Razer Tartarus V2

+@import Cocoa;+@import LuaSkin;++#include <stdio.h>+#import <Foundation/Foundation.h>++#include "razerdevice.h"+#include "razerkbd_driver.h"++#import <IOKit/hid/IOHIDManager.h>+#import <IOKit/hid/IOHIDUsageTables.h>++#import <IOKit/hidsystem/IOHIDParameter.h>+#import <IOKit/hidsystem/IOHIDEventSystemClient.h>+#import <IOKit/hidsystem/IOHIDServiceClient.h>++#define USERDATA_TAG  "hs.razer"+static LSRefTable refTable = LUA_NOREF;++#define get_objectFromUserdata(objType, L, idx, tag) (objType*)*((void**)luaL_checkudata(L, idx, tag))++#pragma mark - Support Functions and Classes++@interface HSRazer : NSObject++@property (nonatomic, strong) id    ioHIDManager;++@property NSNumber*                 internalDeviceId;+@property NSNumber*                 productId;++@property int                       selfRefCount;+@property int                       callbackRef;+@property id                        callbackToken;+@property int                       deviceCallbackRef;++@property LSGCCanary                lsCanary;++@end++@implementation HSRazer++- (instancetype)init+{+    self = [super init];+    if (self)+    {+        _callbackRef                = LUA_NOREF;+        _deviceCallbackRef          = LUA_NOREF;+        _callbackToken              = nil;+        _selfRefCount               = 0;+                +        // Create a HID device manager+        self.ioHIDManager = CFBridgingRelease(IOHIDManagerCreate(kCFAllocatorDefault, kIOHIDManagerOptionNone));+                +        NSDictionary *matchTartarusV2   = @{ @(kIOHIDVendorIDKey): @0x1532, @(kIOHIDProductIDKey): @0x022b };+        +        IOHIDManagerSetDeviceMatchingMultiple((__bridge IOHIDManagerRef)self.ioHIDManager,+                                              (__bridge CFArrayRef)@[matchTartarusV2]);++        // Add our callbacks for relevant events+        IOHIDManagerRegisterDeviceMatchingCallback((__bridge IOHIDManagerRef)self.ioHIDManager,+                                                   HIDconnect,+                                                   (__bridge void*)self);+        IOHIDManagerRegisterDeviceRemovalCallback((__bridge IOHIDManagerRef)self.ioHIDManager,+                                                  HIDdisconnect,+                                                  (__bridge void*)self);+        +        IOHIDManagerRegisterInputValueCallback((__bridge IOHIDManagerRef)self.ioHIDManager, keyboardCallback, NULL);++        // Start our HID manager+        IOHIDManagerScheduleWithRunLoop((__bridge IOHIDManagerRef)self.ioHIDManager,+                                        CFRunLoopGetMain(),+                                        kCFRunLoopDefaultMode);+        +        IOHIDManagerOpen((__bridge IOHIDManagerRef)self.ioHIDManager, kIOHIDOptionsTypeNone);+        +        // NOTE: This gives Hammerspoon exclusive access to the Razer device, but requires `root` permissions+        //       so it's not very helpful.+        //IOHIDManagerOpen((__bridge IOHIDManagerRef)self.ioHIDManager, kIOHIDOptionsTypeSeizeDevice);+        +        CFRunLoopRun();+    }+    return self;+}++#pragma mark - IOKit C callbacks++static void keyboardCallback(void* context, IOReturn result, void* sender, IOHIDValueRef value)

Ignore this... worked it out, I wasn't passing the context correctly.

latenitefilms

comment created time in 7 days

PullRequestReviewEvent
PullRequestReviewEvent

Pull request review commentHammerspoon/hammerspoon

hs.razer - Added support for Razer Tartarus V2

+/*+ * This program is free software; you can redistribute it and/or modify+ * it under the terms of the GNU General Public License as published by+ * the Free Software Foundation; either version 2 of the License, or+ * (at your option) any later version.+ *+ * This program is distributed in the hope that it will be useful,+ * but WITHOUT ANY WARRANTY; without even the implied warranty of+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the+ * GNU General Public License for more details.+ *+ * You should have received a copy of the GNU General Public License+ * along with this program; if not, write to the Free Software+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA+ *+ * Should you need to contact me, the author, you can do so by+ * e-mail - mail your message to Terry Cain <terry@terrys-home.co.uk>+ */++#include <stdio.h>+#include <stdlib.h>+#include <string.h>+#include <math.h>++#include "razerkbd_driver.h"+#include "razerchromacommon.h"+#include "razercommon.h"++static struct razer_report razer_send_payload(IOUSBDeviceInterface **dev, struct razer_report *request_report);++bool is_blade_laptop(IOUSBDeviceInterface **usb_dev)+{+    UInt16 product = -1;+    (*usb_dev)->GetDeviceProduct(usb_dev, &product);++    switch (product)+    {+    case USB_DEVICE_ID_RAZER_BLADE_STEALTH:+    case USB_DEVICE_ID_RAZER_BLADE_STEALTH_LATE_2016:+    case USB_DEVICE_ID_RAZER_BLADE_PRO_LATE_2016:+    case USB_DEVICE_ID_RAZER_BLADE_2018:+    case USB_DEVICE_ID_RAZER_BLADE_2018_MERCURY:+    case USB_DEVICE_ID_RAZER_BLADE_2018_BASE:+    case USB_DEVICE_ID_RAZER_BLADE_2019_ADV:+    case USB_DEVICE_ID_RAZER_BLADE_MID_2019_MERCURY:+    case USB_DEVICE_ID_RAZER_BLADE_STUDIO_EDITION_2019:+    case USB_DEVICE_ID_RAZER_BLADE_QHD:+    case USB_DEVICE_ID_RAZER_BLADE_LATE_2016:+    case USB_DEVICE_ID_RAZER_BLADE_STEALTH_MID_2017:+    case USB_DEVICE_ID_RAZER_BLADE_STEALTH_LATE_2017:+    case USB_DEVICE_ID_RAZER_BLADE_STEALTH_2019:+    case USB_DEVICE_ID_RAZER_BLADE_PRO_2017:+    case USB_DEVICE_ID_RAZER_BLADE_PRO_2017_FULLHD:+    case USB_DEVICE_ID_RAZER_BLADE_2019_BASE:+    case USB_DEVICE_ID_RAZER_BLADE_STEALTH_LATE_2019:+        return true;+    }++    return false;+}++/**+ * Read device file "game_mode"+ *+ * Returns a string+ */+ssize_t razer_attr_read_mode_game(IOUSBDeviceInterface **usb_dev, char *buf)+{+    struct razer_report report = razer_chroma_standard_get_led_state(VARSTORE, GAME_LED);+    struct razer_report response;++    response = razer_send_payload(usb_dev, &report);+    return sprintf(buf, "%d\n", response.arguments[2]);+}++/**+ * Write device file "mode_macro" + *+ * When 1 is written (as a character, 0x31) Macro mode will be enabled, if 0 is written (0x30)+ * then game mode will be disabled+ */+ssize_t razer_attr_write_mode_macro(IOUSBDeviceInterface **usb_dev, const char *buf, int count)+{+    unsigned char enabled = (unsigned char)strtol(buf, NULL, 10);+    struct razer_report report = razer_chroma_standard_set_led_state(VARSTORE, MACRO_LED, enabled);++    razer_send_payload(usb_dev, &report);++    return count;+}++/**+ * Write device file "mode_macro_effect"+ *+ * When 1 is written the LED will blink, 0 will static+ */+ssize_t razer_attr_write_mode_macro_effect(IOUSBDeviceInterface **usb_dev, const char *buf, int count)+{++    struct razer_report report = {0};+    unsigned char enabled = (unsigned char)strtoul(buf, NULL, 10);++    UInt16 product = -1;+    (*usb_dev)->GetDeviceProduct(usb_dev, &product);++    switch (product)+    {+    case USB_DEVICE_ID_RAZER_BLACKWIDOW_LITE:+    case USB_DEVICE_ID_RAZER_ORNATA:+    case USB_DEVICE_ID_RAZER_ORNATA_CHROMA:+    case USB_DEVICE_ID_RAZER_ORNATA_CHROMA_V2:+    case USB_DEVICE_ID_RAZER_HUNTSMAN_ELITE:+    case USB_DEVICE_ID_RAZER_HUNTSMAN_TE:+    case USB_DEVICE_ID_RAZER_BLACKWIDOW_2019:+    case USB_DEVICE_ID_RAZER_HUNTSMAN:+    case USB_DEVICE_ID_RAZER_BLACKWIDOW_ESSENTIAL:+    case USB_DEVICE_ID_RAZER_CYNOSA_CHROMA:+    case USB_DEVICE_ID_RAZER_CYNOSA_LITE:+    case USB_DEVICE_ID_RAZER_BLACKWIDOW_V3:+    case USB_DEVICE_ID_RAZER_BLACKWIDOW_V3_TK:+    case USB_DEVICE_ID_RAZER_HUNTSMAN_MINI:+        report = razer_chroma_standard_set_led_effect(NOSTORE, MACRO_LED, enabled);+        report.transaction_id.id = 0x3F;+        break;++    case USB_DEVICE_ID_RAZER_TARTARUS_V2:+    case USB_DEVICE_ID_RAZER_BLACKWIDOW_ELITE:+        report = razer_chroma_standard_set_led_effect(NOSTORE, MACRO_LED, enabled);+        report.transaction_id.id = 0x1F;+        break;++    case USB_DEVICE_ID_RAZER_ANANSI:+        report = razer_chroma_standard_set_led_effect(NOSTORE, MACRO_LED, enabled);+        razer_send_payload(usb_dev, &report);++        report = razer_chroma_standard_set_led_blinking(NOSTORE, MACRO_LED);+        break;++    default:+        report = razer_chroma_standard_set_led_effect(VARSTORE, MACRO_LED, enabled);+        break;+    }+    razer_send_payload(usb_dev, &report);++    return count;+}++/**+ * Read device file "macro_mode_effect"+ *+ * Returns a string+ */+ssize_t razer_attr_read_mode_macro_effect(IOUSBDeviceInterface **usb_dev, char *buf)+{+    struct razer_report report = razer_chroma_standard_get_led_effect(VARSTORE, MACRO_LED);+    struct razer_report response = razer_send_payload(usb_dev, &report);++    return sprintf(buf, "%d\n", response.arguments[2]);+}++/**+ * Write device file "mode_pulsate"+ *+ * The brightness oscillates between fully on and fully off generating a pulsing effect+ */+ssize_t razer_attr_write_mode_pulsate(IOUSBDeviceInterface **usb_dev, const char *buf, int count)+{+    struct razer_report report = razer_chroma_standard_set_led_effect(VARSTORE, BACKLIGHT_LED, 0x02);+    razer_send_payload(usb_dev, &report);++    UInt16 product = -1;+    (*usb_dev)->GetDeviceProduct(usb_dev, &product);++    switch (product)+    {+    case USB_DEVICE_ID_RAZER_BLACKWIDOW_STEALTH:+    case USB_DEVICE_ID_RAZER_BLACKWIDOW_STEALTH_EDITION:+    case USB_DEVICE_ID_RAZER_BLACKWIDOW_ULTIMATE_2012:+    case USB_DEVICE_ID_RAZER_BLACKWIDOW_ULTIMATE_2013:+        report = razer_chroma_standard_set_led_effect(VARSTORE, LOGO_LED, 0x02);+        break;+    }++    return count;+}++/**+ * Read device file "mode_pulsate"+ *+ * Returns a string+ */+ssize_t razer_attr_read_mode_pulsate(IOUSBDeviceInterface **usb_dev, char *buf)+{+    struct razer_report report = razer_chroma_standard_get_led_effect(VARSTORE, LOGO_LED);+    struct razer_report response = razer_send_payload(usb_dev, &report);++    return sprintf(buf, "%d\n", response.arguments[2]);+}++/**+ * Read device file "profile_led_red"+ *+ * Actually a Yellow LED+ *+ * Returns a string+ */+ssize_t razer_attr_read_tartarus_profile_led_red(IOUSBDeviceInterface **usb_dev, char *buf)+{+    struct razer_report report = razer_chroma_standard_get_led_state(VARSTORE, RED_PROFILE_LED);+    struct razer_report response = razer_send_payload(usb_dev, &report);++    // CHRIS MODIFIED:+    //return sprintf(buf, "%d\n", response.arguments[2]);+    +    return response.arguments[2];+}++/**+ * Read device file "profile_led_green"+ *+ * Returns a string+ */+ssize_t razer_attr_read_tartarus_profile_led_green(IOUSBDeviceInterface **usb_dev, char *buf)+{+    struct razer_report report = razer_chroma_standard_get_led_state(VARSTORE, GREEN_PROFILE_LED);+    struct razer_report response = razer_send_payload(usb_dev, &report);++    // CHRIS MODIFIED:+    //return sprintf(buf, "%d\n", response.arguments[2]);+    +    return response.arguments[2];+    +}++/**+ * Read device file "profile_led_blue"+ *+ * Returns a string+ */+ssize_t razer_attr_read_tartarus_profile_led_blue(IOUSBDeviceInterface **usb_dev, char *buf)+{+    struct razer_report report = razer_chroma_standard_get_led_state(VARSTORE, BLUE_PROFILE_LED);+    struct razer_report response = razer_send_payload(usb_dev, &report);++    // CHRIS MODIFIED:+    //return sprintf(buf, "%d\n", response.arguments[2]);+    +    return response.arguments[2];+}++/**+ * Read device file "get_firmware_version"+ *+ * Returns a string+ */+ssize_t razer_attr_read_get_firmware_version(IOUSBDeviceInterface **usb_dev, char *buf)+{+    struct razer_report report = razer_chroma_standard_get_firmware_version();+    struct razer_report response_report = razer_send_payload(usb_dev, &report);+    +    // MODIFIED BY CHRIS:+    //return sprintf(buf, "v%d.%d\n", response_report.arguments[0], response_report.arguments[1]);

@asmagill - This code was crashing. Any suggestions on how I can "join" these two unsigned char's?

latenitefilms

comment created time in 8 days

Pull request review commentHammerspoon/hammerspoon

hs.razer - Added support for Razer Tartarus V2

+@import Cocoa;+@import LuaSkin;++#include <stdio.h>+#import <Foundation/Foundation.h>++#include "razerdevice.h"+#include "razerkbd_driver.h"++#import <IOKit/hid/IOHIDManager.h>+#import <IOKit/hid/IOHIDUsageTables.h>++#import <IOKit/hidsystem/IOHIDParameter.h>+#import <IOKit/hidsystem/IOHIDEventSystemClient.h>+#import <IOKit/hidsystem/IOHIDServiceClient.h>++#define USERDATA_TAG  "hs.razer"+static LSRefTable refTable = LUA_NOREF;++#define get_objectFromUserdata(objType, L, idx, tag) (objType*)*((void**)luaL_checkudata(L, idx, tag))++#pragma mark - Support Functions and Classes++@interface HSRazer : NSObject++@property (nonatomic, strong) id    ioHIDManager;++@property NSNumber*                 internalDeviceId;+@property NSNumber*                 productId;++@property int                       selfRefCount;+@property int                       callbackRef;+@property id                        callbackToken;+@property int                       deviceCallbackRef;++@property LSGCCanary                lsCanary;++@end++@implementation HSRazer++- (instancetype)init+{+    self = [super init];+    if (self)+    {+        _callbackRef                = LUA_NOREF;+        _deviceCallbackRef          = LUA_NOREF;+        _callbackToken              = nil;+        _selfRefCount               = 0;+                +        // Create a HID device manager+        self.ioHIDManager = CFBridgingRelease(IOHIDManagerCreate(kCFAllocatorDefault, kIOHIDManagerOptionNone));+                +        NSDictionary *matchTartarusV2   = @{ @(kIOHIDVendorIDKey): @0x1532, @(kIOHIDProductIDKey): @0x022b };+        +        IOHIDManagerSetDeviceMatchingMultiple((__bridge IOHIDManagerRef)self.ioHIDManager,+                                              (__bridge CFArrayRef)@[matchTartarusV2]);++        // Add our callbacks for relevant events+        IOHIDManagerRegisterDeviceMatchingCallback((__bridge IOHIDManagerRef)self.ioHIDManager,+                                                   HIDconnect,+                                                   (__bridge void*)self);+        IOHIDManagerRegisterDeviceRemovalCallback((__bridge IOHIDManagerRef)self.ioHIDManager,+                                                  HIDdisconnect,+                                                  (__bridge void*)self);+        +        IOHIDManagerRegisterInputValueCallback((__bridge IOHIDManagerRef)self.ioHIDManager, keyboardCallback, NULL);++        // Start our HID manager+        IOHIDManagerScheduleWithRunLoop((__bridge IOHIDManagerRef)self.ioHIDManager,+                                        CFRunLoopGetMain(),+                                        kCFRunLoopDefaultMode);+        +        IOHIDManagerOpen((__bridge IOHIDManagerRef)self.ioHIDManager, kIOHIDOptionsTypeNone);+        +        // NOTE: This gives Hammerspoon exclusive access to the Razer device, but requires `root` permissions+        //       so it's not very helpful.+        //IOHIDManagerOpen((__bridge IOHIDManagerRef)self.ioHIDManager, kIOHIDOptionsTypeSeizeDevice);+        +        CFRunLoopRun();+    }+    return self;+}++#pragma mark - IOKit C callbacks++static void keyboardCallback(void* context, IOReturn result, void* sender, IOHIDValueRef value)

@asmagill - If you get a chance, are you able to help me with some basic structural things? For example, how can I trigger the Lua callback from within this function (i.e. how can I access the _callbackRef from here)?

latenitefilms

comment created time in 8 days

PullRequestReviewEvent

PR opened Hammerspoon/hammerspoon

hs.razer - Added support for Razer Tartarus V2
  • This is very much a work-in-progress. I'm only submitting a draft pull request to get help and support, and to alert others that might be interested in this little side-project.
  • Currently I'm only focussing on supporting the Razer Tartarus V2, however, in theory it would be possible to support other Razer devices.
  • Will eventually close #2921
+10330 -46

0 comment

29 changed files

pr created time in 8 days

create barnchlatenitefilms/hammerspoon

branch : issue-2921-hs-razer

created branch time in 8 days

issue commentHammerspoon/hammerspoon

hs.razer - Add support for Razer Tartarus V2

Note to self - this code looks like it should be able to remap keys using code, taking into account the ProductID:

https://gist.github.com/heiner/ca5b66b673d5514e520ad8099a9c905e#file-remapping-cc

latenitefilms

comment created time in 8 days

issue comment1kc/librazermacos

Capturing the button presses from a Razer Tartarus V2?

No stress at all! Thanks for the fast reply!

latenitefilms

comment created time in 9 days

issue commentHammerspoon/hammerspoon

hs.razer - Add support for Razer Tartarus V2

https://stackoverflow.com/questions/30380400/how-to-tap-hook-keyboard-events-in-osx-and-record-which-keyboard-fires-each-even

latenitefilms

comment created time in 10 days

issue commentHammerspoon/hammerspoon

hs.razer - Add support for Razer Tartarus V2

Doesn't seem to... I can just type this in Terminal:

hidutil property --matching '{"ProductID":0x022b}' --set '{"UserKeyMapping": 
 [{"HIDKeyboardModifierMappingSrc":0x70000002C,
   "HIDKeyboardModifierMappingDst":0x700000004
 }]
}'

...and it just works.

Note to self:

  • https://stackoverflow.com/questions/8676135/osx-hid-filter-for-secondary-keyboard
  • https://gist.github.com/GaretJax/3783042
latenitefilms

comment created time in 10 days

issue commentHammerspoon/hammerspoon

hs.razer - Add support for Razer Tartarus V2

It seems that most people using the Razer Tartarus V2 on macOS without the official Synapse software are basically using Karabiner-Elements to remap the default Razer Tartarus V2 keyboard layout to whatever they want.

Ideally, I don't want to rely on Karabiner-Elements, so I had a play with using hidutil instead, and it worked great:

hidutil property --matching '{"ProductID":0x022b}' --set '{"UserKeyMapping": 
 [{"HIDKeyboardModifierMappingSrc":0x70000002C,
   "HIDKeyboardModifierMappingDst":0x700000004
 }]
}'

In the above case I'm remapping the "20" button, which defaults to "spacebar", to the "a" key.

This hidutil generator is pretty handy:

https://hidutil-generator.netlify.app

It also looks like you can do this via code as well:

https://developer.apple.com/library/archive/technotes/tn2450/_index.html

This actual explains how IOHIDKeyboardFilter and hidutil works:

https://www.nanoant.com/mac/macos-function-key-remapping-with-hidutil

...and links to this source code:

https://opensource.apple.com/source/IOHIDFamily/IOHIDFamily-1090.260.23/IOHIDEventSystemPlugIns/IOHIDKeyboardFilter.mm

Here's the source for hidutil:

https://opensource.apple.com/source/IOHIDFamily/IOHIDFamily-1090.220.12/tools/hidutil/

However, whilst remapping the keys to different keys is cool - it still doesn't really solve my actual problem - in that I actually want to trigger individual Hammerspoon code for each button.

So now I'm wondering, @asmagill - does the above IOHIDKeyboardFilter.mm or hidutil code give you any ideas how we could add "device filtering" to hs.eventtap?

latenitefilms

comment created time in 10 days

issue opened1kc/librazermacos

Capturing the button presses from a Razer Tartarus V2?

Apologies in advance for a slightly off-topic issue.

I'm interested in using a Razer Tartarus V2 on macOS without any of the official Razer software, which is how I came across this awesome repo.

I've played around with this code, and it gives fantastic control in terms of changing all the LEDs on the Razer Tartarus V2 - great work!

However, I'm interested in how I can detect the button presses on a Razer Tartarus V2, without them triggering any keyboard buttons on macOS. It seems that, by default the Razer Tartarus V2 has a built-in layout that trigger normal keyboard button presses - whereas I'm hoping to trigger specific things when the buttons are pressed.

Is the main purpose of this repo to just concentrate on the LED controls - or are you planning to add the ability to change what the buttons do any some stage?

I'm completely new to Razer and Synapse, so apologies if I'm missing something obvious.

Any words of wisdom you can provide would be greatly appreciated. Thank you!

created time in 10 days

issue commentHammerspoon/hammerspoon

hs.razer - Add support for Razer Tartarus V2

Actually, after playing around with https://github.com/1kc/librazermacos it seems this really only takes care of changing the LED colours - not actually handling the button presses. By default the Razer Tartarus V2 just seems to trigger regular key presses.

@asmagill & @cmsj - I'm sure this has been discussed before, but is there anyway to modify hs.eventtap to target specific devices?

latenitefilms

comment created time in 10 days

issue openedHammerspoon/hammerspoon

hs.razer - Add support for Razer Tartarus V2

I've discussed this before in other issues (#2447, #2876), but something I'd love to tackle sooner rather than later is add support for the Razer Tartarus V2 to Hammerspoon, offering a similar extension to hs.streamdeck.

Hardware:

  • https://www.razer.com/gaming-keypads/Razer-Tartarus-V2/RZ07-02270100-R3U1

Useful Code:

  • https://github.com/1kc/librazermacos

Related:

  • https://github.com/1kc/razer-macos
  • https://github.com/FruityRazer/FruityKit
  • https://github.com/kprinssu/osx-razer-blade
  • https://github.com/openrazer/openrazer (Linux Only)
  • https://github.com/z3ntu/razer_test (Works on macOS)
  • https://github.com/CalcProgrammer1/openrazer-win32 (Windows Only)

created time in 11 days

push eventCommandPost/CommandPost

Chris Hocking

commit sha 6a0e1b3ff81dc50e72aec7c2d8beaae73fd3364c

Fixed bug in Loupedeck manager - Closes #2743

view details

push time in 15 days