Duplicate Keystrokes - Again, Again! [Alan Hourihane, please comment]

Harold L Hunt II huntharo@msu.edu
Thu Apr 10 14:04:00 GMT 2003


Duncan,

Duncan Cragg wrote:
> 
>>
>> Sorry, I haven't got a clue how to help you.  I spent hours 
>> investigating the duplicate keystrokes problem many months ago.  I 
>> described some of what I learned in the following email:
>>
>> http://www.cygwin.com/ml/cygwin-xfree/2002-02/msg00195.html
> 
> 
> 
> Yup: as my original email indicated with the Google link, I have read 
> the history!!
> 

I know, I just wanted to make sure that you had read that particular 
message.

>>
>>
>> All I could see is that for certain instances of Windows keypress 
>> messages we were generating two keystrokes in the X Client with the 
>> focus.  I followed this as low as I could with gdb and it was always a 
>> single keystroke as far as I could see, but it magically turned into 
>> two keystrokes at some level beyond where I could look.  I speculated 
>> that perhaps this was something in the MI layer trying to do an 
>> "autorepeat" for us, which we don't want it to do.  It could be the 
>> delay between the down message and the up message that is causing 
>> this.  But, like I said, I looked through almost all of the code and 
>> nowhere could I find a part that looped and created extra keypresses 
>> in the X Client.
>>
> 
> In support of your conclusion, I tried a simple 'xset r off'.  This 
> fixes the problem for me (or, at least, makes it so much reduced that I 
> haven't seen it yet), and, of course, I still get key repeats off Windows.
> 
> Thanks for replying; I still find it hard to believe that this is such a 
> rare problem that it is given low priority. Must be one of my '.*' files 
> that's making it worse!
> 

Ah ha!  You have found the mysterious repeating of keys that I have been 
looking for!  I kept saying, "I give up... must be some sort of internal 
repeat mechanism".  My Google searches for such a mechanism kept coming 
up empty... but with "xset r" I was able to find out that xset uses the 
XF86Misc extension to set the repeat rate, among other things.

I started working on turning off the repeat rate in the server 
initialization, but I ran into a problem.  See, we don't have the 
XF86MISC extension compiled in, so I can't figure out how xset is 
causing an effect when it sets the repeat rate.  Furthermore, I have 
looked at the hw/xfree86/common/ implementation of xf86SetKbdRate... 
most of them use setb () or ioctl ()'s which wouldn't seem to apply to 
use.  My understanding of setb () is that it is used to set flags in 
hardware... but I could be wrong.

[Alan, please comment:]

Does anyone know if setb () in this case is just setting a hard-wired 
memory address used by the X Server to store the repeat rate internally?

Thanks for your investigative work,

Harold

> Cheers
> 
> 
> Duncan Cragg
> 
> 
>>
>>> Since there's been no response to this, I thought I'd add a little 
>>> more detail in the hope of
>>> triggerring a reaction!!!
>>> See after this copy-paste of my original email:
>>>
>>>> Hello - I've just arrived at this list, so hope I don't break 
>>>> protocol in any way!!
>>>>
>>>> I have a problem which can be summarised as 'it's the same as the 
>>>> following past postings':
>>>>
>>>> http://www.google.com/search?hl=en&lr=&ie=UTF-8&q=+site:www.cygwin.com+xfree86+duplicate+keystrokes 
>>>>
>>>>
>>>> The discussions there mentioned the infrequency of the problem of 
>>>> duplicate keystrokes for the respondents - a couple of times a day.
>>>>
>>>> I, however, am getting this problem all the time: as in, every five 
>>>> commands or so, or every five edit keystrokes....!!!!
>>>>
>>>> Am I alone?
>>>>
>>>> Am I doing something odd?
>>>>
>>>> This happens on both my work and home installations (work is 1G, 
>>>> home is 500M laptop; home has VNC running which I can see would make 
>>>> this worse, but work is not overloaded). Both installations are 
>>>> out-of-the-box, running twm. I can supply more details (.Xmodmap, 
>>>> .twmrc, .Xdefaults, etc.) if someone thinks it's relevant.
>>>>
>>>> Any help appreciated!
>>>>
>>>>
>>>> Duncan Cragg
>>>>
>>> So my work machine is NT and this problem only manifests when doing 
>>> an ssh to one of my home machines and running up an editor.  It's bad 
>>> enough that it's intolerable for editing - repeated keystrokes 
>>> occurring every 10 or so.
>>>
>>> At home it's much worse - this machine is running Windows 2000. Like 
>>> I said, it's a 500Mhz and running VNC - but I've tried turning off 
>>> some of the VNC checkboxes, without any improvement. VNC is only 
>>> using a tiny bit of CPUanyway. I can't see a 'disable VNC' checkbox 
>>> or option anywhere to completely switch it off though.  I get 
>>> repeated chars even on a bash prompt on the local machine - and it's 
>>> about every five or so keystrokes, biased towards carriage returns 
>>> and big events like shifting down half a page. It occurs equally on 
>>> ssh's to other machines on local xterms as to xterms launched from 
>>> those machines.
>>>
>>> The thing these setups have in common is the .xinitrc, .twmrc, 
>>> .Xdefaults and .Xmodmap files.  Can anyone suggest one of these to 
>>> start adjusting? I can supply relevant sections - if anyone has a 
>>> clue what's relevant!!
>>>
>>> Thanks in advance for any help with this one!!
>>>
>>> OK - I'll look at building from source and fiddling with code, if 
>>> that'll prove I'm serious!! I'm going to have to get Exceed (shput!) 
>>> if I can't resolve this...  If no-one responds to this email, I'll 
>>> keep the list informed of how I'm getting on.  It'll be a riveting 
>>> saga, I'm sure...   =0) Oh - if we can fix that problem where 
>>> alt-Tabbing into or out of Xfree splatters tabs over the in-focus 
>>> window, it'll be a bonus. This has been suggested as related in the 
>>> above threads...
>>>
>>>
>>> Duncan Cragg
>>>
>>>
>>>
>>>
>>>
>>>
>>
>>
>>
> 



More information about the Cygwin-xfree mailing list