Slashdot Mirror


X With No Mouse Cursor

innocent_white_lamb writes "I am using an X-based menu that doesn't recognize a mouse. Keyboard input only. I load the menu with the command "startx -e menu", which loads the menu and gets stuff going without any need for a window manager. The problem is that the mouse cursor sits in the middle of the screen and, without a mouse attached, there appears to be no way to move it or get rid of it. I've asked around and nobody seems to have run into this situation before. So my question is, how do you get rid of the mouse cursor under X without using a window manager?"

10 of 46 comments (clear)

  1. Use the force Luke! by Ashran · · Score: 4, Informative

    Set the X/Y init position somewhere off the screen and recompile.

    --

    Before you email me, remember: "There is no god!"
  2. unclutter by halfnerd · · Score: 3, Informative

    unclutter does the job for you

    1. Re:unclutter by halfnerd · · Score: 4, Informative

      Even found you an url:
      http://packages.debian.org/stable/x11/unclut ter.ht ml

  3. change the cursor by dj.delorie · · Score: 5, Informative
    xfd -fn cursor

    then choose a cursor that's blank as the default. Or substitute a cursor font that's nothing but blanks.

  4. Moving the cursor without a mouse by ion_ · · Score: 5, Informative

    without a mouse attached, there appears to be no way to move it or get rid of it.

    You can move the cursor by pressing Ctrl-Shift-Num Lock and then using the numpad. You move the cursor with the keys around 5, click with 5, etc. A quick googling brought up this webpage.

  5. Just write a small program by metalhed77 · · Score: 4, Informative

    that uses XWarpPointer[sic] to move the pointer wherever on boot.

    --
    Photos.
    1. Re:Just write a small program by sforman · · Score: 2, Informative

      or just use this one

  6. from XJ.cpp in the mythtv distribution by benwb · · Score: 4, Informative

    void XvVideoOutput::hide_cursor(void)
    {
    Cursor no_ptr;
    Pixmap bm_no;
    XColor black, dummy;
    Colormap colormap;
    static char no_data[] = { 0,0,0,0,0,0,0,0 };

    colormap = DefaultColormap(XJ_disp, DefaultScreen(XJ_disp));
    XAllocNamedColor(XJ_disp, colormap, "black", &black, &dummy);
    bm_no = XCreateBitmapFromData(XJ_disp, XJ_win, no_data, 8, 8);
    no_ptr = XCreatePixmapCursor(XJ_disp, bm_no, bm_no, &black, &black, 0, 0);

    XDefineCursor(XJ_disp, XJ_win, no_ptr);
    XFreeCursor(XJ_disp, no_ptr);
    }

  7. Problem solved by Permission+Denied · · Score: 3, Informative
    Start up the program "bitmap" that comes standard with XFree86. It starts with an empty bitmap. Save the empty bitmap to "empty.xbm." Click the "invert" button to set all the pixels in the bitmap. Save this bitmap to "full.xbm."

    Now type:

    xsetroot -cursor empty.xbm full.xbm
    This changes the root cursor to the empty bitmap you just created.

    Instead of "startx -e menu" write a shell script with two lines:

    #!/bin/sh
    xsetroot -cursor /path/to/empty.xbm /path/to/full.xbm
    exec menu
    Have "startx" execute this script, or simply make this script your .xinitrc.

    Problem solved.

    However, if the "menu" program you speak of does not simply inherit the root window's cursor (default behaviour), you will need either to modify the program to do so (eg, comment out the cursor-setting lines, grep for XSetWindowAttributes or XDefineCursor), or to modify your cursor font so the cursor it uses is the blank one you created. If the program creates its own cursor rather than using a standard cursor from the cursor font, you need to modify the source. It's probably much easier to modify the source anyway, since it only takes a grep and a recompile, whereas if you want to modify your cursor font, you have to find some font editing program and deal with someone's idea of a usable graphical interface.

    If you don't have source to your program, you'll need to break out the hex editor. If this is the case and you don't know i386 asm, post a URL to the program.

  8. Invisible cursor by BESTouff · · Score: 2, Informative
    Here is your invisible cursor:
    • Create a file named emptycursor containing:
      #define nn1_width 16
      #define nn1_height 16
      static unsigned char nn1_bits[] = {
      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
    • type this command:
      xsetroot -cursor emptycursor emptycursor
    • Profit !