LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
Search this Thread
Old 01-08-2009, 12:41 AM   #1
prasadbrg
LQ Newbie
 
Registered: Nov 2003
Posts: 27

Rep: Reputation: 15
Question Spurious keyboard events(?) and associated quirkyness


Hello everyone,
I'm running Mandriva 2009 on a Compaq Presario 2184AT notebook (2.4GHz Celeron, 1 GB RAM). From quite some time now (even when I was had Mandriva 2007 on the same machine), there was this little irritating problem - occasionally, the cursor in any text box (for example, the search bar in firefox) would start rapidly flickering, and copy-pasting would behave erratically, i.e. ctrl-c ctrl-v over selected text would not ensure that the selected text gets pasted. The flickering would dissappear, though, the moment I typed anything from the keyboard - so the problem wasn't so serious (still, irritating!). At the time, I had 512MB + 128MB (2 slots) of RAM.

I recently upgraded the OS to Mandriva 2009. I'd hoped that the niggling issue would dissappear, but it didn't - perhaps marginally reduced, but still present. The copy-pasting is still erratic, and I found out why - clicking on the Klipper applet reveals that the instead of one clipboard entry being highlighted, the highlighting is rapidly flickering and jumping across the clipboard history.

The problem went from irritating to serious when I recently started using the SPE Python editor. Whenever this flickering starts, a strange character, which looks like an 'L' (except with both arms equal length and a dot in the centre), gets continuously spewed onto the screen. The instant code checker in SPE gives this error message: "UnicodeEncodeError('ascii',u'import \u013f\n', 7, 8, 'ordinal not in range(128)')", with the \u013f\ being repeated for every character that appears on the screen. It stops with anything being typed, and at some random time, starts again. This *only* happens when the cursor is flickering across applications, and the clipboard selection is jumping, so I'm very sure this is not a problem with SPE, just that SPE is most sensitive to it.

The problem almost goes away when I disable keyboard repeats from the KDE system settings (but it's not a KDE thing - I get the same issue in ICEWM, and even in the X login screen). Now, in SPE, instead of a stream of the strange character, I get a single instance, occasionally (which can be too often). Of course, disabling keyboard repeats makes using other things painful, so it's not a solution.

I recently upgraded the RAM to 512MB +512MB, and funnily, the problem reduced noticably. Using Gkrellm, I found that the problem appears whenever CPU usage is high - around 99%, so it's not random as it seemed before.

I checked the ASCII table, and found that 013 is "Vertical Tab". Could it be that the keyboard is generating spurious Vertical Tab events?

My sincere apologies for the long post - but the issue is hard to describe and reproduce, but serious enough - I do need to use SPE. I would appreciate any help in this regard.
Thanks in advance!

Cheers,
Guru

Last edited by prasadbrg; 01-08-2009 at 12:46 AM.
 
Old 01-09-2009, 12:43 AM   #2
J.W.
LQ Veteran
 
Registered: Mar 2003
Location: Milwaukee, WI
Distribution: Mint
Posts: 6,642

Rep: Reputation: 69
Maybe your keyboard itself is faulty. Can you use a substitute, and if so does the problem go away? I recently had an issue where my Shift key was stuck, which produced various unexpected behaviors
 
Old 01-09-2009, 02:46 AM   #3
prasadbrg
LQ Newbie
 
Registered: Nov 2003
Posts: 27

Original Poster
Rep: Reputation: 15
Thanks, J.W. for the reply.
I will hunt around for a test keyboard. Meanwhile, your reply got me thinking about a possible long-term solution (since the machine is a notebook, and an additional keyboard would be painful).
The SPE errors seem to consistently specify a single key error - u013. If this means that the same ASCII character is being triggered (I don't know the correct technical description), is there some way it can be 'mapped' to some other, more harmless key (e.g. 'alt' or 'fn'), or better still, completely ignored? I don't have any experience with these, and I hope there is an easy way out!
Cheers,
Guru
 
Old 01-09-2009, 03:56 AM   #4
prasadbrg
LQ Newbie
 
Registered: Nov 2003
Posts: 27

Original Poster
Rep: Reputation: 15
Smile Found the cultprit! But still need help...

After my last post, I googled around a bit, and found the xev and xmodmap programs. I started xev, and initially nothing happened. I cranked up the CPU usage a bit, and sure enough, the flickering started, and the strange character began being spewed on to the SPE editor. xev now revealed a continuous stream of KeyPress and KeyRelease events, with keycode = 111:
Code:
KeyPress event, serial 34, synthetic NO, window 0x3800001,
    root 0x6c, subw 0x0, time 7541645, (157,-9), root:(984,442),
    state 0x0, keycode 111 (keysym 0x0, NoSymbol), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyRelease event, serial 34, synthetic NO, window 0x3800001,
    root 0x6c, subw 0x0, time 7541683, (157,-9), root:(984,442),
    state 0x0, keycode 111 (keysym 0x0, NoSymbol), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False
I then typed 'xmodmap -pke' in the shell, and found that 'keycode 111 = Print Sys_Req'. I tried typing in the 'prt sc/sys rq' key, and it did not register at all in xev - although all surrounding keys did (So yes, it appears that J.W. is right, it seems to be a keyboard issue). Also, hitting either the '9' or the '0' keys triggered the keycode 111 events, along with their own appropriate codes. One thing that I hadn't mentioned earlier was that a sure way to trigger the strange character in SPE was to hit either of these keys.
Having found the culprit, I wanted to see if I could use xmodmap to 'ignore' the offending keycode. In the shell, I typed 'xmodmap -e "keycode 111 = ". It worked! Even when the flickering started, the strange character did not appear in the SPE editor. This makes the problem much less severe than before - I can use SPE without hassles now.
But it remains that this is a poor workaround - the issue of the flickering remains, making copy-pasting difficult at times. Now, in xev output, I find this stream: '...^@^@^@...'. which means the keyboard is still sending those spurious events. Although it is definately a hardware issue, it seems closely connected with CPU usage. It's an old notebook, and the local HP service centre refuses to even look at it. Short of keyboard replacement, are there any other more permanent solutions?
Thanks in advance,

Cheers,
Guru

Last edited by prasadbrg; 01-09-2009 at 04:01 AM. Reason: Added xev output
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Keyboard events interrupting mouse events. miner49er Linux - Hardware 3 11-04-2008 04:16 AM
X and keyboard events? kalleanka Programming 2 03-11-2008 09:03 PM
ps/2 keyboard -> usb connector generating spurious keystrokes on suse 9.3 Thespian Linux - Hardware 6 03-13-2006 04:41 PM
Keyboard and mouse events Soltis Linux - General 3 03-23-2005 09:25 AM
Keyboard events under GNOME Dj Supreme Programming 1 02-13-2004 04:59 AM


All times are GMT -5. The time now is 05:50 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration