Отправляет email-рассылки с помощью сервиса Sendsay

[TC] фокус потерян

Здравствуйте, industry.

Часто объявляет "фокус потерян".
Надоедает.
Как это исправить:

Ответить   Sun, 28 Jul 2019 10:12:29 +0300 (#3625044)

 

Ответы:

Здравствуйте, Иван.

отвечаю на письмо от 28 июля 2019 г., 10:12:29:

скрипт написан вместе с юрием шабановым.
скрипт будет работать только при включеном произнесении потере фокуса,
его можно включить по нажатию инсерт+v, иначе до скрипта дело не доходит.
после отработки этого скрипта фокус перемещается на первое открытое
окно, если таковых нет, то на рабочий стол. скрипты тестировались на
win7, 10 и под jaws 15, 18, 2019.

создайте в пользовательской папке файл default.jss. в нём напишите
следующие строки:

include "MSAAConst.jsh"
Include "UIA.jsh"
include "Common.jsm"
include "HJConst.jsh"
include "HJGlobal.jsh"

use "default.jsb"

int Function SpeakInvisibleWindow ()
var
handle hFocus,
string sCursorShape,
string sProgressName,
string sProgress
;conditions in which this function should not speak:
let sCursorShape = getCursorShape ()
if sCursorShape == cscWAIT || sCursorShape == cscAppStart then
return FALSE
endIf
Let hFocus = getFocus ()
;previous or current window in exceptions list, e.g. no announce:
if hFocus
&& (stringContains (cwnFocusLossExceptionsList, globalPrevRealName)
|| StringContains (cwnFocusLossExceptionsList, getWindowName (getRealWindow
(globalFocusWindow)))) then
return
endIf
;tool tip, help balloon: actions are in progress, so not really "out of
focus"
if isWindowVisible (ghwndToolTip) then
return FALSE
endIf
;If a progress bar is running, prevent this from speaking:
if isWindowVisible (GetProgressBarInfo (sProgressName, sProgress))
|| ! StringIsBlank (sProgressName)
|| ! StringIsBlank (sProgress) then
return FALSE
endIf
if ! hFocus;no foreground
|| (hFocus && ! isWindowVisible (hFocus);foreground is invisible,
;this invalid circumstance mans the whole app's hierarchy is invisible, out
of scope but still has keyboard focus.
&& ! isWindowVisible (getParent (hFocus))) then
SayUsingVoice (vctx_message, cmsgFocusLoss, OT_SCREEN_MESSAGE)
if hFocus then
BrailleMessage (cmsgBrlLostFocus, OFF, 10000);keep message
up until user can act
endIf
;Tutor message goes here, as the event does not go off, and we don't
want to create timing problems with duplicate (forced) event calls,
resulting in an unknown function call.
SayUsingVoice (vctx_message, cmsgFocusLossTutor, OT_TUTOR)
GetRestoreWindow ()
Return TRUE
;All windows have closed, save the desktop and task bar
elIf AllAppsClosedFromSystemTray (hFocus) then
SayUsingVoice (vctx_message, cmsgFocusLoss, OT_SCREEN_MESSAGE)
if hFocus then
BrailleMessage (cmsgBrlLostFocus, OFF, 10000);keep message
up until user can act
endIf
;Tutor message goes here, as the event does not go off, and we don't
want to create timing problems with duplicate (forced) event calls,
resulting in an unknown function call.
if ShouldItemSpeak(OT_TUTOR) == TUTOR_ALL then
SayMessage (OT_TUTOR, cmsgFocusLossTutor)
EndIf
; Delay (2)
GetRestoreWindow ()
Return TRUE
endIf
endFunction

Void Function GetRestoreWindow ()
var
object oUIA,
object oFocus,
object oTitle,
handle hWnd,
object oColection,
int iCount, int i

let oUIA = CreateObjectEx ("freedomsci.UIA", false,
"UIAScriptAPI.x.manifest")
let oFocus = oUIA.GetRootElement ().BuildUpdatedCache ()
if oFocus then
;let oColecTion = oFocus.FindAll(TreeScope_Children,
oUIA.CreateOrCondition(oUIA.CreateintPropertyCondition
(UIA_LegacyIAccessibleRolePropertyId , 16),
oUIA.CreateIntPropertyCondition (UIA_LegacyIAccessibleRolePropertyId, 10)))
let oColecTion = oFocus.FindAll(TreeScope_Children,
oUIA.CreateOrCondition(oUIA.CreateintPropertyCondition
(UIA_ControlTypePropertyId , UIA_WindowControlTypeId),
oUIA.CreateIntPropertyCondition (UIA_ControlTypePropertyId ,
UIA_PaneControlTypeId)))
let iCount = oColection.count -1
let i = 0
while i < iCount && (!oColection(i).name || StringStartsWith
(oColection(i)name, "Панель задач", 0))
let i = i +1
endWhile
let hwnd = oColection(i).nativeWindowHandle
setfocus(hwnd)
let oTitle = GetObjectFromEvent (hWnd, objid_TITLEBAR, 3, i)
oTitle.AccDoDefaultAction(i)
endif
EndFunction

Ответить   Mon, 29 Jul 2019 11:53:52 +0300 (#3625121)

 

Доброго времени суток всему сообществу!
Из ранее прочитанного: создайте в пользовательской папке файл
default.jss. в нём напишите
следующие строки:

Можно, пожалуйсто, чуть поподробнее: если имеется ввиду папка
пользовательских настроек Jaws, то названая папка там уже существует по
умолчанию, а если создавать эту папку в директории пользователь, это ничего
не дает. Так всетаки, где ее создавать или куда прописывать данный скрипт?
Не сочтите за труд слегка расширить пояснение.
Всего доброго. Сергей.

Ответить   Tue, 30 Jul 2019 00:23:22 +1000 (#3625175)

 

Здравствуйте, Сергей.

отвечаю на письмо от 29 июля 2019 г., 17:23:22:

создайте в папке jaws для пользователя файл default.jss, если он
существует, то проверте есть ли в нём ниже следующие строки, если нет,
то допишите их:

include "MSAAConst.jsh"
Include "UIA.jsh"
include "Common.jsm"
include "HJConst.jsh"
include "HJGlobal.jsh"

use "default.jsb"

; если ниже следующий скрипт существует в файле скриптов поумолчанию в
;папке jaws для пользователя, то перепишите его.
int Function SpeakInvisibleWindow ()
var
handle hFocus,
string sCursorShape,
string sProgressName,
string sProgress
;conditions in which this function should not speak:
let sCursorShape = getCursorShape ()
if sCursorShape == cscWAIT || sCursorShape == cscAppStart then
return FALSE
endIf
Let hFocus = getFocus ()
;previous or current window in exceptions list, e.g. no announce:
if hFocus
&& (stringContains (cwnFocusLossExceptionsList, globalPrevRealName)
|| StringContains (cwnFocusLossExceptionsList, getWindowName (getRealWindow
(globalFocusWindow)))) then
return
endIf
;tool tip, help balloon: actions are in progress, so not really "out of
focus"
if isWindowVisible (ghwndToolTip) then
return FALSE
endIf
;If a progress bar is running, prevent this from speaking:
if isWindowVisible (GetProgressBarInfo (sProgressName, sProgress))
|| ! StringIsBlank (sProgressName)
|| ! StringIsBlank (sProgress) then
return FALSE
endIf
if ! hFocus;no foreground
|| (hFocus && ! isWindowVisible (hFocus);foreground is invisible,
;this invalid circumstance mans the whole app's hierarchy is invisible, out
of scope but still has keyboard focus.
&& ! isWindowVisible (getParent (hFocus))) then
SayUsingVoice (vctx_message, cmsgFocusLoss, OT_SCREEN_MESSAGE)
if hFocus then
BrailleMessage (cmsgBrlLostFocus, OFF, 10000);keep message
up until user can act
endIf
;Tutor message goes here, as the event does not go off, and we don't
want to create timing problems with duplicate (forced) event calls,
resulting in an unknown function call.
SayUsingVoice (vctx_message, cmsgFocusLossTutor, OT_TUTOR)
GetRestoreWindow ()
Return TRUE
;All windows have closed, save the desktop and task bar
elIf AllAppsClosedFromSystemTray (hFocus) then
SayUsingVoice (vctx_message, cmsgFocusLoss, OT_SCREEN_MESSAGE)
if hFocus then
BrailleMessage (cmsgBrlLostFocus, OFF, 10000);keep message
up until user can act
endIf
;Tutor message goes here, as the event does not go off, and we don't
want to create timing problems with duplicate (forced) event calls,
resulting in an unknown function call.
if ShouldItemSpeak(OT_TUTOR) == TUTOR_ALL then
SayMessage (OT_TUTOR, cmsgFocusLossTutor)
EndIf
; Delay (2)
GetRestoreWindow ()
Return TRUE
endIf
endFunction

; этот скрипт нужно просто скопировать в файл default.jss
; после всех действий надо скомпилировать этот файл.
Void Function GetRestoreWindow ()
var
object oUIA,
object oFocus,
object oTitle,
handle hWnd,
object oColection,
int iCount, int i

let oUIA = CreateObjectEx ("freedomsci.UIA", false,
"UIAScriptAPI.x.manifest")
let oFocus = oUIA.GetRootElement ().BuildUpdatedCache ()
if oFocus then
;let oColecTion = oFocus.FindAll(TreeScope_Children,
oUIA.CreateOrCondition(oUIA.CreateintPropertyCondition
(UIA_LegacyIAccessibleRolePropertyId , 16),
oUIA.CreateIntPropertyCondition (UIA_LegacyIAccessibleRolePropertyId, 10)))
let oColecTion = oFocus.FindAll(TreeScope_Children,
oUIA.CreateOrCondition(oUIA.CreateintPropertyCondition
(UIA_ControlTypePropertyId , UIA_WindowControlTypeId),
oUIA.CreateIntPropertyCondition (UIA_ControlTypePropertyId ,
UIA_PaneControlTypeId)))
let iCount = oColection.count -1
let i = 0
while i < iCount && (!oColection(i).name || StringStartsWith
(oColection(i)name, "Панель задач", 0))
let i = i +1
endWhile
let hwnd = oColection(i).nativeWindowHandle
setfocus(hwnd)
let oTitle = GetObjectFromEvent (hWnd, objid_TITLEBAR, 3, i)
oTitle.AccDoDefaultAction(i)
endif
EndFunction

Ответить   Mon, 29 Jul 2019 21:02:19 +0300 (#3625218)

 

Привет рассылка!
jaws 18 windows 7. 64
при компиляции скрипта выдается ошибка
Ошибка компиляции
Error: Duplicate constant definition
ОК
где что подправить?

Ответить   Mon, 29 Jul 2019 18:31:46 +0300 (#3625228)

 

Здравствуйте, Серёга.

отвечаю на письмо от 29 июля 2019 г., 18:31:46:

проверте строки начинающиеся с include, они не должны повторяться.

Ответить   Tue, 30 Jul 2019 08:32:05 +0300 (#3625251)