Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a linux laptop connected to an external monitor, keyboard and mouse. How can I have the laptop's keyboard and trackpad be independent from the external keyboard and mouse so I can keep them exclusively on the laptop's screen and use the external keyboard and mouse primarily on the external monitor?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

I found a solution to the problem and I wrote a script to toggle mouse and keyboard splitting:

#!/bin/bash

xinput list | grep "main keyboard" -c > /dev/null

if [ $? -ne 0 ]; then
  echo "Splitting laptop leyboard and touchpad..."
  echo "Creating xinput main"
  xinput create-master "main"
  echo "Reattaching laptop touchpad and keyboard to main"
  xinput reattach "SynPS/2 Synaptics TouchPad" "main pointer"
  xinput reattach "AT Translated Set 2 keyboard" "main keyboard"
else
  echo "Merging laptop keyboard and touchpad..."
  echo "Reattaching laptop touchpad and keyboard to core"
  xinput reattach "SynPS/2 Synaptics TouchPad" "Virtual core pointer"
  xinput reattach "AT Translated Set 2 keyboard" "Virtual core keyboard"
  echo "Removing xinput main"
  xinput remove-master "main keyboard"
fi
share|improve this answer
    
+1 nice example. It also helps for 1) dual cursor 2) dual inputs –  YumYumYum May 7 '12 at 11:28

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.