File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1647,6 +1647,11 @@ def _get_states(self):
16471647 if s != UIAHandler .handler .reservedNotSupportedValue :
16481648 if not role :
16491649 role = self .role
1650+ if s == UIAHandler .ToggleState_Indeterminate :
1651+ if role == controlTypes .Role .TOGGLEBUTTON :
1652+ states .add (controlTypes .State .HALFPRESSED )
1653+ else :
1654+ states .add (controlTypes .State .HALFCHECKED )
16501655 if role == controlTypes .Role .TOGGLEBUTTON :
16511656 if s == UIAHandler .ToggleState_On :
16521657 states .add (controlTypes .State .PRESSED )
Original file line number Diff line number Diff line change 202202 controlTypes .State .SELECTED : _ ("sel" ),
203203 # Displayed in braille when an object (e.g. a toggle button) is pressed.
204204 controlTypes .State .PRESSED : u"⢎⣿⡱" ,
205+ # Displayed in braille when an object (e.g. a toggle button) is half pressed.
206+ controlTypes .State .HALFPRESSED : u"⢎⣸⡱" ,
205207 # Displayed in braille when an object (e.g. a check box) is checked.
206208 controlTypes .State .CHECKED : u"⣏⣿⣹" ,
207209 # Displayed in braille when an object (e.g. a check box) is half checked.
Original file line number Diff line number Diff line change 199199STATE_PRESSED = State .PRESSED
200200STATE_CHECKED = State .CHECKED
201201STATE_HALFCHECKED = State .HALFCHECKED
202+ STATE_HALFPRESSED = State .HALFPRESSED
202203STATE_READONLY = State .READONLY
203204STATE_EXPANDED = State .EXPANDED
204205STATE_COLLAPSED = State .COLLAPSED
Original file line number Diff line number Diff line change @@ -126,7 +126,7 @@ def _processNegativeStates(
126126 and (reason != OutputReason .CHANGE or State .FOCUSED in states )
127127 ):
128128 speakNegatives .add (State .CHECKED )
129- if role == Role .TOGGLEBUTTON :
129+ if role == Role .TOGGLEBUTTON and State . HALFPRESSED not in states :
130130 speakNegatives .add (State .PRESSED )
131131 if reason == OutputReason .CHANGE :
132132 # We want to speak this state only if it is changing to negative.
@@ -138,6 +138,9 @@ def _processNegativeStates(
138138 # #6946: if HALFCHECKED is present but CHECKED isn't, we should make sure we add CHECKED to speakNegatives.
139139 if (State .HALFCHECKED in negativeStates and State .CHECKED not in states ):
140140 speakNegatives .add (State .CHECKED )
141+ if State .HALFPRESSED in negativeStates and State .PRESSED not in states :
142+ speakNegatives .add (State .PRESSED )
143+
141144 if STATES_SORTED & negativeStates and not STATES_SORTED & states :
142145 # If the object has just stopped being sorted, just report not sorted.
143146 # The user doesn't care how it was sorted before.
Original file line number Diff line number Diff line change @@ -96,6 +96,7 @@ def negativeDisplayString(self) -> str:
9696 # indeterminate progress bar, aka busy indicator. No specific state label.
9797 # when combined with role of 'progress bar', role is mutated to 'busy indicator'
9898 INDETERMINATE = setBit (44 )
99+ HALFPRESSED = setBit (45 )
99100
100101
101102STATES_SORTED = frozenset ([State .SORTED , State .SORTED_ASCENDING , State .SORTED_DESCENDING ])
@@ -116,6 +117,8 @@ def negativeDisplayString(self) -> str:
116117 State .CHECKED : _ ("checked" ),
117118 # Translators: This is presented when a three state check box is half checked.
118119 State .HALFCHECKED : _ ("half checked" ),
120+ # Translators: This is presented when a three state toggle button is half pressed.
121+ State .HALFPRESSED : _ ("half pressed" ),
119122 # Translators: This is presented when the control is a read-only control such as read-only edit box.
120123 State .READONLY : _ ("read only" ),
121124 # Translators: This is presented when a tree view or submenu item is expanded.
You can’t perform that action at this time.
0 commit comments