I've been playing around today and ended up modifying the PS3 remote plugin to generate "repeat" events for long and mixed presses (separate events for long and mixed). This allows simple scrolling through lists, etc. I've also worked out how to make the PS3 remote work without any extra intervention after resuming from standby. If I could wake from standby using the remote I wouldn't need anything else, but my bluetooth adaptor doesn't allow it ...
The "repeat" event codes look like:
- Code: Select all
HID.Up.L#
HID.Up.M#
HID.Down.L#
HID.Down.M#
By default, I've configured the repeat interval to be 0.00 (no repeat). Any positive non-zero value means that the appropriate "repeat" event will be generated at that interval after the "long press" event is generated until the key is released. For example, if the "long press" wait is 0.50 seconds, and the "repeat" interval is 0.06 seconds, you will get events like:
- Code: Select all
0.50 HID.Up.L
0.56 HID.Up.L#
0.62 HID.Up.L#
0.68 HID.Up.L#
...
0.?? HID.Release
I think I'd like to add the interval as payload i.e. instead produce:
- Code: Select all
0.50 HID.Up.L
0.56 HID.Up.L# [0.06]
0.62 HID.Up.L# [0.12]
0.68 HID.Up.L# [0.18]
...
0.?? HID.Release
I've found in my testing that 0.06 seems optimal for scrolling through lists. If I have it any faster on my machine, events get queued up and you can't guarantee that you can stop appropriately. Testing is needed on other machines.
BTW, I haven't quite done things correctly here - I'm actually doing fixed delay rather than fixed time i.e. the sequence is actually:
- Code: Select all
Wait for long press timeout
Trigger long press event
Wait for repeat interval
Trigger long press repeat event
Wait for repeat interval
Trigger long press repeat event
What I should be doing is:
- Code: Select all
Get event time
Calculate when the long press should time out
Wait for remainder of long press timeout
Trigger long press event
Calculate when the repeat interval should time out
Wait for remainder of repeat interval
Trigger long press repeat event
Calculate when the repeat interval should time out
Wait for remainder of repeat interval
Trigger long press repeat event
I also had to do some extra work to ensure that if a button is being held down when the PC goes into standby (e.g. configured Standby on HID.Zarbi.L) that it doesn't continue to spew unusable events when the PC wakes up (stopping the timer threads in various situations).
I've attached my modified version (I've labelled it 2.02 to distinguish it) plus an example configuration file demonstrating how I'm using it. The plugin is backwards-compatible with version 2.0.1 (I've added a parameter with a default value of 0.0 to __start__).
The configuration file also demonstrates how to ensure that the PS3 remote is usable when waking from standby (or a reboot). My bluetooth adaptor is from a Logitech MX900, which doesn't automatically use HCI mode, so I force it to HCI when EventGhost starts or the PC wakes up (other dongles may not need this step). Then when the various devices are discovered I disable and re-enable the PS3 remote plugin - once this has been done, pressing any button on the remote will connect to the PC and generate events.
