`

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

分享到:
评论

相关推荐

    gromit-mpx:Gromit-MPX是一种屏幕注释工具,可与X11以及Wayland下的任何Unix桌面环境一起使用

    由于支持Multi-Pointer X (MPX)和Wayland,Gromit-MPX允许多个鼠标或触摸输入设备同时操作,这在多人协作或演示时特别有用。用户可以同时进行不同的注解,提高效率。 3. **桌面环境兼容性**: 无论用户选择的是...

    DS-5安装及Streamline使用指南

    - `Device Drivers -> USB Network Adapters -> [ * ] ASIX AX88772x Based USB 2.0 Ethernet Adapters` - 修改 `Makefile` 文件,在 `HOSTCFLAGS` 行的末尾添加 `-g -fno-inline -fno-omit-frame-pointer` 编译...

    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 ...

    The-C-Programming-Language(bookmarked)

    printf("x: %d, y: %d\n", x, y); return 0; } ``` - **1.9 Character Arrays** - 字符数组的声明和使用。 - 字符串操作函数:`strlen()`, `strcpy()`, `strcat()` 等。 - 示例代码: ```c char str[] = ...

    C++语言编写的迷宫----完整代码

    在迷宫生成器中,使用随机数生成迷宫,迷宫的墙壁用“#”表示,路径用“X”表示,死路用“@”表示。用户可以输入迷宫的大小,然后选择自己的走法(a、s、d、w控制方向)或者查看答案。 知识点: 1. 结构体(Struct...

    android 多点触摸demo

    在Android平台上,多点触摸(Multi-Touch)技术允许用户同时使用两个或更多手指与屏幕进行交互,极大地丰富了移动应用的用户体验。本"android 多点触摸demo"旨在为开发者提供一个实践和理解Android多点触摸功能的...

    多点触控控制字体大小,源码中有详细注释,简单Demo.zip

    在Android开发中,多点触控(Multi-Touch)是一种常见的用户交互方式,它允许用户同时使用多个手指进行操作,增强了设备的互动性。在这个"多点触控控制字体大小,源码中有详细注释,简单Demo.zip"的项目中,我们可以...

    应用源码之单点与多点触摸.zip

    接着,我们探讨多点触摸(Multi-Touch)。多点触摸在Android中主要是通过MotionEvent的 ACTION_POINTER_DOWN 和 ACTION_POINTER_UP 来实现。ACTION_POINTER_DOWN 表示有额外的手指触碰屏幕,ACTION_POINTER_UP 表示...

    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...

    Android多点触控技术实战,对图片进行缩放和移动Demo

    在Android开发中,多点触控(Multi-Touch)技术是一项关键特性,它允许用户同时使用两个或更多手指与屏幕进行交互,实现如缩放、旋转、拖动等操作。本示例主要针对图片的双指缩放和移动进行实战演示,通过分析这段...

    Android应用源码之单点与多点触摸.zip

    二、多点触摸(Multi-Touch) 多点触摸是指同时处理两个或更多的触摸点,这对于实现手势识别如缩放、旋转等操作至关重要。Android从API 8(Android 2.2, Froyo)开始支持多点触摸。 处理多点触摸同样需要在`...

    android多点触摸实例及疑问

    在Android开发中,多点触摸(Multi-Touch)功能是一个重要的特性,它允许用户通过两个或更多的手指同时与屏幕交互,实现缩放、旋转、滑动等手势操作。本实例将深入探讨Android多点触摸的实现,并解答相关疑问。 ...

    Learn Java 17 Programming 2nd Edition

    CLinker.link(CLinker.C_POINTER, segment.address(), "hello"); 8. **Enhanced Deprecation Support:** - Java 17 introduces a new `--enable-preview` flag that can be used to enable deprecated APIs that ...

    android多点触摸

    在Android平台上,多点触摸(Multi-Touch)技术允许用户同时使用两个或更多的手指与屏幕进行交互,极大地丰富了移动应用的用户体验。本教程将深入探讨Android中的多点触摸处理,包括基本概念、API使用以及如何创建一...

    android多点触控

    在Android平台上,多点触控(Multi-Touch)技术为用户提供了更加丰富的交互方式,使得应用程序可以支持同时处理两个或更多的触摸输入。这种技术在现代移动设备上非常常见,尤其在设计手势操作、图片浏览、游戏等应用...

    Android屏幕多点触摸

    在Android系统中,多点触摸(Multi-Touch)是一项关键特性,它允许用户同时使用两个或更多个手指进行交互,提供了更加丰富的用户界面体验。在本篇内容中,我们将深入探讨如何实现Android屏幕的多点触摸功能,并进行...

    \Linux一句话精彩回答.pdf

    - **命令**: `xmodmap -e 'pointer = 1 2 3 4 5 6 7'` - **描述**: 使用`xmodmap`命令可以配置鼠标的滚轮功能。上述命令将鼠标滚轮映射到了标准的滚轮事件上。 ### 9. 安装X Window - **命令**: `sudo apt install ...

    安卓Android源码——多点触控控制字体大小,源码中有详细注释,简单Demo.rar

    在安卓(Android)开发中,实现多点触控(Multi-Touch)功能可以让用户通过两个或更多的手指同时操作,提供更丰富的交互体验。本示例着重讲解如何利用Android源码实现多点触控来控制字体大小。源码中的`...

    Demo 多点触摸 缩放 图片

    在iOS和Android等移动操作系统中,多点触摸(Multi-Touch)是一种常见的用户交互方式,它允许用户通过两个或更多的手指触碰屏幕来执行各种操作。在这个“Demo 多点触摸 缩放 图片”项目中,我们主要关注的是如何实现...

Global site tag (gtag.js) - Google Analytics