LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices

Reply
 
Search this Thread
Old 06-11-2012, 03:42 AM   #1
Hikaru1024
LQ Newbie
 
Registered: Jun 2012
Posts: 1

Rep: Reputation: Disabled
Problem and solution(s) with using scroll lock triggered kvm switch in X windows


Earlier today I became the owner of a usb based kvm switch which replaced an older model that used ps/2 connectors. In any case, I noticed almost instantly that switching from my windows PC to my linux pc using the keyboard shortcut (scroll lock&scroll lock&up/down arrow) worked but did NOT do so from the linux PC. There are apparently a lot of threads on a great many websites detailing how to do workarounds, but none of them worked particularly well for me.

One popular and simple workaround which worked for me was to switch to console (alt+ctrl+F1) before trying to switch between machines. When you switch back you should be able to get back into X by pressing alt+F7 (F6 for some distributions.) I didn't like it however since it requires I switch to console and back again, adding another step.

One which did not work, but I'm going to list it anyway due to it working for other people and being less intrusive than what I eventually did is to modify the keyboard map into lighting the scroll lock LED when you press the scroll lock key.
(workaround copypasted from https://bugs.launchpad.net/ubuntu/+s...ev/+bug/912044)

Find an unused mapping:
$ xmodmap -pm
Use the "modX" which has nothing applied to it, then try (assuming modX = mod3 from xmodmap -pm output):
$ xmodmap -e "add mod3 = Scroll_Lock"

If this works for you note that you will need to modify your startup script for the user (usually ~/.xinitrc) to execute the second xmodmap line

To be clear, this did not work for me. Inexplicably however, I noticed that lighting the LED's quickly and turning them off using xset, pausing, then doing it again caused it to switch. Even better yet, I was able to figure out how to use a keyboard shortcut in fluxbox to trigger a script.

My workaround, which triggers when I press scroll lock twice:

edit ~/.fluxbox/keys and append to the end as the last line:

Scroll_Lock Scroll_Lock :Exec ~/local/bin/switchcomputers

then

mkdir -p ~/local/bin

and create the file ~/local/bin/switchcomputers with the contents:

!/bin/bash
xset led 3 && sleep 0.2 && xset -led 3 && sleep 2 && xset led 3 && sleep 0.2 && xset -led 3

save and quit, then

chmod +x ~/local/bin/switchcomputers

Note that this will create the script in a subdirectory of your user's homedir, this may not be what you want. Also, you can probably modify other window managers (eg, kde/gnome) keyboard shortcuts to run the script or an equivalent.

I cannot guarantee success, but I thought that since I had discovered something that worked well for me that I should inform others about it.
 
  


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
KVM Conceptronic CKVM2U and Xwindows Scroll-lock twice don't works mgumbau Linux - Hardware 4 02-24-2014 03:43 AM
KVM-switch problem no scroll-lock key agts Linux - Newbie 8 12-21-2011 09:44 PM
problems with Scroll Lock and KVM switch on FC4 fuct Linux - Software 2 01-12-2006 11:51 AM
problems with Scroll Lock and KVM switch on FC4 fuct Linux - Hardware 1 12-22-2005 01:51 AM
Scroll Mouse Problem : Solution :) Libu Linux - Newbie 3 05-30-2004 02:56 AM


All times are GMT -5. The time now is 06:58 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