`

Multi-Pointer X

阅读更多

 MPX

Starting with Ubuntu 10.04 LTS, Ubuntu includes support for Multi-Pointer X. This allows the user to use multiple input devices simultaneously.
Setting up two pointers

First, run

xinput list

You will see something like this:

  $ xinput list
  ⎡ Virtual core pointer                          id=2    [master pointer  (3)]
  ⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
  ⎜   ↳ Mouse0                                    id=6    [slave  pointer  (2)]
  ⎜   ↳ Mouse1                                    id=7    [slave  pointer  (2)]
  ⎜   ↳ Mouse1                                    id=9    [slave  pointer  (2)]
  ⎣ Virtual core keyboard                         id=3    [master keyboard (2)]
      ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
      ↳ Keyboard0                                 id=8    [slave  keyboard (3)]
      ↳ Keyboard1                                 id=10   [slave  keyboard (3)]

Both of the mice and keyboards are connected to the Virtual core pointer and Virtual core keyboard. Let's create a new master (pointer and keyboard set), and put the "Mouse0" and "Keyboard0" there.

  $ xinput create-master Second

This should make another pointer appear on the screen. However, nothing is attached to it yet. Run xinput list and look at the output:

  $ xinput list
  ⎡ Virtual core pointer                          id=2    [master pointer  (3)]
  ⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
  ⎜   ↳ Mouse0                                    id=6    [slave  pointer  (2)]
  ⎜   ↳ Mouse1                                    id=7    [slave  pointer  (2)]
  ⎜   ↳ Mouse1                                    id=9    [slave  pointer  (2)]
  ⎣ Virtual core keyboard                         id=3    [master keyboard (2)]
      ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
      ↳ Keyboard0                                 id=8    [slave  keyboard (3)]
      ↳ Keyboard1                                 id=10   [slave  keyboard (3)]
  ⎡ Second pointer                                id=11   [master pointer  (12)]
  ⎜   ↳ New XTEST pointer                         id=13   [slave  pointer  (11)]
  ⎣ Second keyboard                               id=12   [master keyboard (11)]
      ↳ New XTEST keyboard                        id=14   [slave  keyboard (11)]

Now, you need to move the Mouse0 and Keyboard0 to the new master. As you see above, Mouse0's id is 6. You want it to be moved from Virtual core pointer to Second pointer, whose id is 11, and you want to move the Keyboard0 who's id is 8 to the Second Keyboard which is 12:

  $ sleep 1&&xinput reattach 6 11&&xinput reattach 8 12

Congratulations, now each of your mice have their own pointer and a keyboard paired with them. The sleep command is to let you quit pressing enter before the reattach commands run. Otherwise, the keyboard will be disconnected before you let up enter, so 'un-enter' will NOT get sent to the previously connected pointer, which will leave that pointer spewing enters.

Reverting back

As of the time of this writing, practically nothing works with MPX flawlessly, and you will probably encounter some annoying glitches especially if compositing is enabled. Once you're done playing with it, you probably want to revert back to "normal" without restarting X. Doing that is easy - you just have to reattach the device back to the Virtual core pointer and remove the master you created:

  $ sleep 1&&xinput reattach 6 2&&xinput reattach 8 3
  $ xinput remove-master 11

Thanks

To whoever wrote http://alec.mooo.com/mpx.php -- this tutorial is heavily based off of it.

X/MPX (last edited 2010-05-06 06:47:09 by erik-b-andersen)

From: https://wiki.ubuntu.com/X/MPX

分享到:
评论

相关推荐

    Bochs - The cross platform IA-32 (x86) emulator

    - display library 'x' now uses the desktop size for the maximum guest resolution - ROM BIOS - Support for up to 2M ROM BIOS images - I/O Devices - 3 new 'pseudo device' plugins created by plugin ...

    EurekaLog_7.5.0.0_Enterprise

    2)....Fixed: Range check error in processes information for x64 machines (affects startup of any EurekaLog-enabled module) 3)....Fixed: Auto-detect personality by project extension if --el_mode switch...

    The Art of Assembly Language Programming

    Pointers to Structures 5.7 - Sample Programs 5.7.1 - Simple Variable Declarations 5.7.2 - Using Pointer Variables 5.7.3 - Single Dimension Array Access 5.7.4 - Multidimensional Array ...

    [原创]自己工作中常用的模板库,简化你的工作

    ☆ get some traits of any function, include all parameter type "Params_T",return type "Return_T", host type "Object_T"(if member-function) , No.x parameter type "GetFunctionParam,x>". this type ...

    ViewPager 放大缩小左右移动

    * Sentinel value for no current active pointer. Used by * {@link #mActivePointerId}. */ private static final int INVALID_POINTER = -1; /** * Determines speed during touch scrolling */ ...

    Google C++ Style Guide(Google C++编程规范)高清PDF

    Tabs Function Declarations and Definitions Function Calls Conditionals Loops and Switch Statements Pointer and Reference Expressions Boolean Expressions Return Values Variable and Array ...

    C++ 标准 ISO 14882-2011

    1.10 Multi-threaded executions and data races . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 1.11 Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...

    BCGControlBarPro.v12.00

    CBCGPRibbonBar::AddBackstageCategory returns a pointer to the new class object - CBCGPRibbonBackstageViewPanel. Usually, you'll need to call the following class methods to create your backstage view: ...

    BobBuilder_app

    Currently MGindex outperforms b+tree by a factor of 15x on writes and 21x on reads, while keeping the main feature of disk friendliness of a b+tree structure. The problem with a b+tree ...

    DebuggingWithGDB 6.8-2008

    5.4 Stopping and Starting Multi-thread Programs . . . . . . . . . . . . . . . . 6 Examining the Stack . . . . . . . . . . . . . . . . . . . . . . 61 6.1 6.2 6.3 6.4 7 Stack Frames . . . . . . . . . . ...

    Google C++ International Standard.pdf

    List of Tables x List of Figures xiv 1 Scope 1 2 Normative references 2 3 Terms and definitions 3 4 General principles 7 4.1 Implementation compliance . . . . . . . . . . . . . . . . . . . . . . . . ....

    最新版的DebuggingWithGDB7.05-2010

    5.4 Stopping and Starting Multi-thread Programs . . . . . . . . . . . . . . . . . 5.4.1 All-Stop Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4.2 Non-...

    Visual C++ 编程资源大全(英文源码 表单)

    69.zip Smart Pointers and other Pointer classes 指针类(5KB)<END><br>70,70.zip Sortable CObArray class 对CObArray类排序(5KB)<END><br>71,71.zip Sortable CObList class 对CObList类排序(6...

Global site tag (gtag.js) - Google Analytics