Chinaunix首页 | 论坛 | 博客
  • 博客访问: 915614
  • 博文数量: 194
  • 博客积分: 7991
  • 博客等级: 少将
  • 技术积分: 2067
  • 用 户 组: 普通用户
  • 注册时间: 2007-12-09 22:03
文章分类

全部博文(194)

文章存档

2010年(8)

2009年(71)

2008年(109)

2007年(6)

我的朋友

分类: LINUX

2009-10-09 17:25:28

Experiencing multiple mouses and multiple keyboards on Fedora 12
Chinese title: 体验Fedora 12下多鼠标多键盘并行操作

By beta-song, 2009-10-09

Keyword: multiple cursor, mutiple mouse, mutiple keyboard, MPX, XServer1.7, XI2

Fedora project always brings us surprise, and Fedora 12 makes no exception. In the accepted feature list of Fedora 12, there is one that makes me most excited, XI2, my today's topic.

XI2 is short for "X Input Extension 2.0", and is available within package xorg-x11-server-1.7.0, which is released on the same day as Chinese National Day, Oct 1st, 2009. XI2 is the second major release of the X Input Extension and allows the simultaneous use of multiple independent input devices. If you got another set of display, mouse, and keyboard attatched to your notebook, you can edit your program codes while at the same time your girl friend can surf on the internet, both using the same notebook, simultaneously and independently, without worrying about the preemption of the input focus, as if you got two separate computers working! XI2 is close to MultiSeat, but it is not MultiSeat, which is declared to be one feature of Fedora 12 early, but which turns out not finally.

This tutorial describes how you can utilize the independent input feature of XI2 under Fedora 12 system. I don't issue any guarantee that this will work for you.

1 Preliminary note
I downloaded Fedora 12 snapshot 3 LiveCD, and installed it to my hard disk. The installation method is beyond the scope of this article, you should get it other way[1]. Here I just asume that your Fedora 12 system just works fine.

In this tutorial we will use an command line utility "xinput", which is avilable in package xorg-x11-apps-7.4.5, you should install that package before launching.

2 Check the input devices list
[root@localhost Download]# xinput list --short
⎡ Virtual core pointer                        id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                  id=4    [slave  pointer  (2)]
⎜   ↳ TPPS/2 IBM TrackPoint                       id=8    [slave  pointer  (2)]
⎜   ↳ Macintosh mouse button emulation            id=9    [slave  pointer  (2)]
⎜   ↳ USB Optical Mouse                           id=13    [slave  pointer  (2)]
⎣ Virtual core keyboard                       id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard                 id=5    [slave  keyboard (3)]
    ↳ ThinkPad Extra Buttons                      id=6    [slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard                id=7    [slave  keyboard (3)]
    ↳ Sleep Button                                id=10    [slave  keyboard (3)]
    ↳ Video Bus                                   id=11    [slave  keyboard (3)]
    ↳ Power Button                                id=12    [slave  keyboard (3)]

3 Plug in another set of display, mouse and keyboard
This is my equipment list:
Display:  ENV 19" LCD
Mouse:    USB Mouse
Keyboard: USB USB Keykoard

Attach them physically to my Thinkpad T61 laptop, and make sure they all work fine.

Let's check the input devices list again:
[root@localhost Download]# xinput list --short
⎡ Virtual core pointer                        id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                  id=4    [slave  pointer  (2)]
⎜   ↳ TPPS/2 IBM TrackPoint                       id=8    [slave  pointer  (2)]
⎜   ↳ Macintosh mouse button emulation            id=9    [slave  pointer  (2)]
⎜   ↳ USB Optical Mouse                           id=13    [slave  pointer  (2)]
⎜   ↳ USB Mouse                                   id=14    [slave  pointer  (2)]
⎜   ↳
USB USB Keykoard                            id=16    [slave  pointer  (2)]
⎣ Virtual core keyboard                       id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard                 id=5    [slave  keyboard (3)]
    ↳ ThinkPad Extra Buttons                      id=6    [slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard                id=7    [slave  keyboard (3)]
    ↳ Sleep Button                                id=10    [slave  keyboard (3)]
    ↳ Video Bus                                   id=11    [slave  keyboard (3)]
    ↳ Power Button                                id=12    [slave  keyboard (3)]
    ↳ USB USB Keykoard                            id=15    [slave  keyboard (3)]

Got the difference? Yes, we got two more input devices added:
USB Mouse                                   id=14    [slave  pointer  (2)]
USB USB Keykoard                            id=16    [slave  pointer  (2)]

4 Create the second cursor
The combination of one mouse and one keyboard is called one input pair, and this pair is presented as one curosr on the screen. This input pair is also called one master device.

The following command create one master device:
[root@localhost Download]# xinput --create-master "sxg input"

Now the input devices list is as follows:
[root@localhost Download]# xinput list --short
⎡ Virtual core pointer                        id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                  id=4    [slave  pointer  (2)]
⎜   ↳ TPPS/2 IBM TrackPoint                       id=8    [slave  pointer  (2)]
⎜   ↳ Macintosh mouse button emulation            id=9    [slave  pointer  (2)]
⎜   ↳ USB Optical Mouse                           id=13    [slave  pointer  (2)]
⎜   ↳ USB Mouse                                   id=14    [slave  pointer  (2)]
⎜   ↳ USB USB Keykoard                            id=16    [slave  pointer  (2)]
⎣ Virtual core keyboard                       id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard                 id=5    [slave  keyboard (3)]
    ↳ ThinkPad Extra Buttons                      id=6    [slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard                id=7    [slave  keyboard (3)]
    ↳ Sleep Button                                id=10    [slave  keyboard (3)]
    ↳ Video Bus                                   id=11    [slave  keyboard (3)]
    ↳ Power Button                                id=12    [slave  keyboard (3)]
    ↳ USB USB Keykoard                            id=15    [slave  keyboard (3)]
⎡ sxg input pointer                           id=17    [master pointer  (18)]
⎜   ↳ sxg input XTEST pointer                     id=19    [slave  pointer  (17)]
⎣ sxg input keyboard                          id=18    [master keyboard (17)]
    ↳ sxg input XTEST keyboard                    id=20    [slave  keyboard (18)]

Next we shoud attach the master devices to physical devices:
[root@localhost Download]# xinput --reattach "USB Mouse" "sxg input pointer"
[root@localhost Download]# xinput --reattach "USB USB Keykoard" "sxg input keyboard"

Again check the input device list:
[root@localhost Download]# xinput list --short
⎡ Virtual core pointer                        id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                  id=4    [slave  pointer  (2)]
⎜   ↳ TPPS/2 IBM TrackPoint                       id=8    [slave  pointer  (2)]
⎜   ↳ Macintosh mouse button emulation            id=9    [slave  pointer  (2)]
⎜   ↳ USB Optical Mouse                           id=13    [slave  pointer  (2)]
⎜   ↳ USB USB Keykoard                            id=16    [slave  pointer  (2)]
⎣ Virtual core keyboard                       id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard                 id=5    [slave  keyboard (3)]
    ↳ ThinkPad Extra Buttons                      id=6    [slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard                id=7    [slave  keyboard (3)]
    ↳ Sleep Button                                id=10    [slave  keyboard (3)]
    ↳ Video Bus                                   id=11    [slave  keyboard (3)]
    ↳ Power Button                                id=12    [slave  keyboard (3)]
⎡ sxg input pointer                           id=17    [master pointer  (18)]
⎜   ↳ USB Mouse                                   id=14    [slave  pointer  (17)]
⎜   ↳ sxg input XTEST pointer                     id=19    [slave  pointer  (17)]
⎣ sxg input keyboard                          id=18    [master keyboard (17)]
    ↳ USB USB Keykoard                            id=15    [slave  keyboard (18)]
    ↳ sxg input XTEST keyboard                    id=20    [slave  keyboard (18)]

After those three steps, the second mouse cursor appears on the screen, and now we are done!

Give your girl friend contorl of the secnod mouse and second keyboard, span your desktop to the second display, check if her surfing could interact your coding, of course not! Good luck!

5 Links
* This article: http://blog.chinaunix.net/u/8754/showart_2066456.html
* Beta-song' blog: http://sxg.cublog.cn

* Fedora 12 accepted features:

* XI2 from Fedora Wiki:

* Fedora-12-snap3:



    

阅读(2815) | 评论(2) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2009-11-28 16:51:40

Thank you! Very helpful.

chinaunix网友2009-10-09 17:39:07

已阅,不懂。