+NEW! Support Deezer in JAWS

This commit is contained in:
theadam 2025-04-12 22:44:02 +02:00
parent ea2230929d
commit 62d49f36f5
2 changed files with 89 additions and 0 deletions

71
deezer/Deezer.JSS Executable file
View file

@ -0,0 +1,71 @@
; Copyright TheAdam <theadam.eu> 2025
; Deezer script to enjoy music smoother!
include "HJConst.jsh"
include "HJGlobal.jsh"
include "HJHelp.jsh"
include "common.jsm"
include "Chrome.jsh"
include "Chrome.jsm"
import "UIA.jsd"
globals
; These two variable required to access globaly the two important window handles
Handle hWndGlob,
Handle hWndStart
Script ScriptFileName()
ScriptAndAppNames("Deezer")
EndScript
void function autoStartEvent()
; run only once to focus when focus moved to Deezer APP
; Enumerate over the subwindows and stop when we'll find the Chrome Legacy Window
; This needed to focus to the webapp as by default the JAWS moves the focus to the banner
If (EnumerateChildWindows(GetParent (hWndStart), "IterWindows") == false)
; Set focus to the window
SetFocus(hWndGlob)
EndIf
endFunction
int function IterWindows(handle hwnd)
; Iterate over the banner's parent's childs
;This needed because banner and webapp are on the same level
Var
string WindowTitle
WindowTitle = GetWindowName(hwnd)
; We store the handle in this global variable to access it in the init function
hwndGlob = hwnd
;Stop when we found the Chrome Legacy Window
If StringContains(WindowTitle, "Chrome Legacy Window")
return False
else
return True
EndIf
endFunction
void function ProcessEventOnFocusChangedEventEx(
handle hwndFocus, int nObject, int nChild,
handle hwndPrevFocus, int nPrevObject, int nPrevChild,
int nChangeDepth, string sClass, int nType)
; Handle focus changes
; We need only once to set up the handle of the webapp
;This handle is the banner and the init script uses the parent handle to start iterate over the childs
hWndStart = hwndFocus
ProcessEventOnFocusChangedEventEx(hwndFocus, nObject, nChild,hwndPrevFocus, nPrevObject, nPrevChild,nChangeDepth, sClass, nType)
EndFunction
script ControlDownArrow ()
; Decrease volume
typeKey (cksControlDownArrow)
endScript
script ControlUpArrow ()
; Increase volume
typeKey (cksControlUpArrow)
endScript

18
deezer/README.md Executable file
View file

@ -0,0 +1,18 @@
# Deezer
## Desktop APP
The Deezer Windows desktop APP is an Electron Chromium based webapp. JAWS can not focus on the webapp when focus moved to Deezer as it has a banner and it handles the focus.
To fix this issue we iterate over the APP on every focus change to Deezer and force JAWS to focus on the content of the WebApp.
## Working features
- Switch to APP easily, do not need to move the focus by hand to the webapp with mouse, touch cursor or menu open-close.
- Volume change up and down with CTRL+up and down arrow keys.
## Todo and known issues
- Do not announce the 'selected' when changing track with SHIFT+left and right arrow keys.
- Find a method to open the local context menu off the APP as it is only available as an unlabelled graphic on the banner.
- Fix the issue that with disabled PC cursor can not move with tab key after focus change. Quick fix to after focus change press tab and after that turn the virtual PC cursor off when needed.
- Announce the current track to INS+t (not only the Deezer APP name).
- Announce track title when switching tracks out of an edit field.