免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1036 | 回复: 0
打印 上一主题 下一主题

Multiple mouses and keyboards in Fedora 12 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-10-09 17:25 |只看该作者 |倒序浏览
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. 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: https://fedoraproject.org/wiki/Releases/12/FeatureList
* XI2 from Fedora Wiki: https://fedoraproject.org/wiki/Features/XI2
* Fedora-12-snap3: http://torrent.fedoraproject.org/torrents/
     


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/8754/showart_2066456.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP