Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is this an error in an accessible object trigger?
#1
I have an accessible object trigger that fires when I click the Play button in VLC. The trigger looks for the button to change/toggle to show a Pause button. This works great. Sometimes. Here is the trigger information I'm using:

STATECHANGE, CLIENT, -2
ow: class="QWidget", text="John Baxton - Tuba Blues - VLC media player"
ao: role=PUSHBUTTON, state=0x10000000, description="Pause the playback"

$a 138 -4 "" "QWidget" "" "VLC media player" "" "" 43 0x10000000 "" "" "Pause the playback" 0x2

Here is what happens:
1) The first time I created the trigger, it works fine.
2) When I close VLC, then open it again, the trigger doesn't fire.
But...
3) I can get the trigger working again without any changes to the trigger or macro.
4) If I use an accessible object wizard or log tool to "look" at the Play button in VLC, and then cancel or close that tool, the trigger suddenly starts working.
Just say HEMP!
#2
VLC does not enable the event, or even does not create the accessible COM object, until something searches for the object. Some programs use "enable accessibility on demand" to start faster, use less memory, etc.

Use this window-triggered function to auto-enable VLC Play/Pause button accessible events.
Function Enable_acc_events_in_VLC
Trigger !cv"VLC media player" "QWidget"     Help - how to add the trigger to the macro
Code:
Copy      Help
int w=TriggerWindow
Acc a.Find(w "PUSHBUTTON" "" "class=QWidget[]descr=^(Play|Pause)" 0x1088)
;out "VLC acc events enabled"

;Possibly enables events only of part of objects, including the Play/Pause button.
;If need to enable for all objects, use this slower code:
;Acc a.Find(w "ALERT")
#3
This works great. Thanks.

How come my original trigger only fires when I actually click on the Play/Pause button and not when the button changes status via a hot key, menu, etc? I was hoping to not have to create a trigger for each method of toggling the the Play/Pause button.
Just say HEMP!
#4
Yes, VLC does not generate events then.


Forum Jump:


Users browsing this thread: 1 Guest(s)