grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Basic mouse support (cursor)


From: Patrick Plenefisch
Subject: Basic mouse support (cursor)
Date: Sun, 29 Jul 2012 11:43:22 -0400

Over the past few days, I've been hacking on GRUB, and implemented mouse support in the form of a virtual keyboard. That is when you move the mouse around it generates arrow key presses or enter on clicks.
The attached patch is based on current bzr trunk (4559) and also fixes a build error with a missing file (reported here: http://lists.gnu.org/archive/html/grub-devel/2012-07/msg00042.html).

I implemented it as a module (based on at_keyboard), so the patch only adds the c and h files and adds it to the modules list. Once compiled and installed, load the ps2mouse module, and run "terminal_input ps2mouse". I highly recommend NOT doing it in your grub.cfg* until you verify it works since it implements its own ps2 keyboard driver (99% copy and pasted from at_keyboard). Once you've set the input to ps2mouse, you can use the mouse, but by default it only allows up and down movement. To enable all movement, run "mousectl enable x". Also disabled by default is clicking; enable with "mousectl mousemode". Since I didn't hire multi-million dollar user studies, the threshold for movement may require some changes to suit your liking. Luckily, its easy to fix with "mousectl sensitivity y someNumber" or "mousectl sensitivity x someNumber" (defaults are 20 and 12 respectively). The "mousectl" command has a few other features, so check the help or source.

I know the source needs a bit of cleanup, but this is the first revision. Any feedback is appreciated. I've tested it in QEMU and on real hardware (wireless usb mouse actually), and only bug is a spurrious right click occationally (which goes to edit mode). I'm currently using this on my computer that has about 30 boot entries, and I really like it since I don't have to hit the down arrow 30 times.

*While testing, I used this entry that I found useful:
menuentry 'Load mouse' {
    terminal_input ps2mouse
    mousectl mousemode
}

Patrick

Attachment: grub-patch1.diff
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]