[orca-list] NumLock causing issues (Re: A really strange bug.)



Hi Darragh:

When my numpad is on, orca doesnât stop speaking when I press the
control key.  Similarly, when arrowing through a menu, it doesnât stop
speaking an item if I move to the next line. 

The numlock key cuases notoriously bad behavior.  I notice that when it
is locked, we don't get any keyboard events via the AT-SPI.  As a
result, speech is not interrupted in Orca because it uses keyboard
events as one reason to interrupt speech.

Now, for what is going wrong...

When I analyze what's going on via at-poke, I see that locking the
numlock results in the modifier mask including 0x4010.  This says bits 4
and 14 are set.  The 4 is to be expected (Num_Lock is mapped to Mod2 on
my machine), but the 14 is not.  

Bit 14 is what is causing problems.  When registering for keyboard
events, I believe the AT-SPI design requires you to explicitly register
for all possible modifier combinations.  The impact is that if we don't
register for combinations of bit 14, we won't get any keyboard events
when bit 14 is set.

So, let's look at what modifiers we see with AT-SPI:

import bonobo
import ORBit
ORBit.load_typelib("Accessibility")
import Accessibility

for modifier in ['MODIFIER_ALT', 'MODIFIER_CONTROL', 'MODIFIER_META', 'MODIFIER_META2', 'MODIFIER_META3', 
'MODIFIER_NUMLOCK', 'MODIFIER_SHIFT', 'MODIFIER_SHIFTLOCK']:
  print modifier, Accessibility.__dict__[modifier]... MODIFIER_ALT 3
MODIFIER_CONTROL 2
MODIFIER_META 4
MODIFIER_META2 5
MODIFIER_META3 6
MODIFIER_NUMLOCK 7
MODIFIER_SHIFT 0
MODIFIER_SHIFTLOCK 1

Orca registers for all possible bitmask combinations of the above.  It
doesn't include bit 14, and I'm not sure it should.  I'm not sure where
the fix really should be, but I suspect the AT-SPI infrastructure should
either expose more modifiers (if things such as bit 14 really map to
modifiers), or it should not consider the modifiers it does not know
about in the decision whether or not to send an event.

Having said that, I'm not sure where the heck bit 14 is coming from.  I
have a sneaking suspicion it might be related to the MouseKeys stuff in
AccessX, but I cannot seem to find anything to help me verify that.

Will






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]