summaryrefslogtreecommitdiffstats
path: root/usr.sbin/sade/menus.c
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1998-03-07 08:59:32 +0000
committerjkh <jkh@FreeBSD.org>1998-03-07 08:59:32 +0000
commit75d39d7a552fc717e9e539107a8fcbf6d84d0e44 (patch)
tree97214572fb85254d213c07c6554304ab412fb0fa /usr.sbin/sade/menus.c
parent6682846885f7b3347088fca27d9c55c86426311e (diff)
downloadFreeBSD-src-75d39d7a552fc717e9e539107a8fcbf6d84d0e44.zip
FreeBSD-src-75d39d7a552fc717e9e539107a8fcbf6d84d0e44.tar.gz
Add a mouse configuration menu.
Submitted by: Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
Diffstat (limited to 'usr.sbin/sade/menus.c')
-rw-r--r--usr.sbin/sade/menus.c138
1 files changed, 91 insertions, 47 deletions
diff --git a/usr.sbin/sade/menus.c b/usr.sbin/sade/menus.c
index d841192..77fe353 100644
--- a/usr.sbin/sade/menus.c
+++ b/usr.sbin/sade/menus.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: menus.c,v 1.153 1998/02/10 18:31:27 jkh Exp $
+ * $Id: menus.c,v 1.154 1998/02/12 17:53:19 yokota Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -341,56 +341,100 @@ DMenu MenuDocumentation = {
{ NULL } },
};
-static int
-whichMouse(dialogMenuItem *self)
-{
- int i;
- char buf[BUFSIZ];
-
- if (!file_readable("/dev/mouse"))
- return FALSE;
- if ((i = readlink("/dev/mouse", buf, sizeof buf)) == -1)
- return FALSE;
- buf[i] = '\0';
- if (!strcmp(self->prompt, "COM1"))
- return !strcmp(buf, "/dev/cuaa0");
- else if (!strcmp(self->prompt, "COM2"))
- return !strcmp(buf, "/dev/cuaa1");
- if (!strcmp(self->prompt, "COM3"))
- return !strcmp(buf, "/dev/cuaa2");
- if (!strcmp(self->prompt, "COM4"))
- return !strcmp(buf, "/dev/cuaa3");
- if (!strcmp(self->prompt, "BusMouse"))
- return !strcmp(buf, "/dev/mse0");
- if (!strcmp(self->prompt, "PS/2"))
- return !strcmp(buf, "/dev/psm0");
- return FALSE;
-}
+DMenu MenuMouseType = {
+ DMENU_RADIO_TYPE | DMENU_SELECTION_RETURNS,
+ "Select a protocol type for your mouse",
+ "If you are not sure, choose \"Auto\". It should always work for bus\n"
+ "and PS/2 style mice. It may not work for the serial mouse if the mouse\n"
+ "does not support the PnP standard. But, it won't hurt. Many 2-button\n"
+ "serial mice are compatible with \"Microsoft\" or \"MouseMan\". 3-button\n"
+ "serial mice may be compatible with \"MouseSystems\" or \"MouseMan\". If\n"
+ "the mouse has a wheel, it may be compatible with \"IntelliMouse\".",
+ NULL,
+ NULL,
+ { { "Auto", "Bus mouse, PS/2 style mouse or PnP serial mouse",
+ dmenuVarCheck, dmenuSetVariable, NULL,
+ VAR_MOUSED_TYPE "=auto" },
+ { "GlidePoint", "ALPS GlidePoint pad (serial)",
+ dmenuVarCheck, dmenuSetVariable, NULL,
+ VAR_MOUSED_TYPE "=glidepoint" },
+ { "Hitachi","Hitachi tablet (serial)",
+ dmenuVarCheck, dmenuSetVariable, NULL,
+ VAR_MOUSED_TYPE "=mmhittab" },
+ { "IntelliMouse", "Microsoft IntelliMouse (serial)",
+ dmenuVarCheck, dmenuSetVariable, NULL,
+ VAR_MOUSED_TYPE "=intellimouse" },
+ { "Logitech", "Logitech protocol (old models) (serial)",
+ dmenuVarCheck, dmenuSetVariable, NULL,
+ VAR_MOUSED_TYPE "=logitech" },
+ { "Microsoft", "Microsoft protocol (serial)",
+ dmenuVarCheck, dmenuSetVariable, NULL,
+ VAR_MOUSED_TYPE "=microsoft" },
+ { "MM Series","MM Series protocol (serial)",
+ dmenuVarCheck, dmenuSetVariable, NULL,
+ VAR_MOUSED_TYPE "=mmseries" },
+ { "MouseMan", "Logitech MouseMan/TrackMan models (serial)",
+ dmenuVarCheck, dmenuSetVariable, NULL,
+ VAR_MOUSED_TYPE "=mouseman" },
+ { "MouseSystems", "MouseSystems protocol (serial)",
+ dmenuVarCheck, dmenuSetVariable, NULL,
+ VAR_MOUSED_TYPE "=mousesystems" },
+ { "ThinkingMouse","Kensington ThinkingMouse (serial)",
+ dmenuVarCheck, dmenuSetVariable, NULL,
+ VAR_MOUSED_TYPE "=thinkingmouse" },
+ { NULL } },
+};
-DMenu MenuMouse = {
+DMenu MenuMousePort = {
DMENU_RADIO_TYPE | DMENU_SELECTION_RETURNS,
- "Please select your mouse type from the following menu",
+ "Select your mouse port from the following menu",
+ "Please note that for PS/2 mice, you need to enable the psm driver\n"
+ "in the kernel configuration menu when installing for the first time.",
+ NULL,
+ NULL,
+ { { "COM1", "Serial mouse on COM1 (/dev/cuaa0)",
+ dmenuVarCheck, dmenuSetVariable, NULL,
+ VAR_MOUSED_PORT "=/dev/cuaa0" },
+ { "COM2", "Serial mouse on COM2 (/dev/cuaa1)",
+ dmenuVarCheck, dmenuSetVariable, NULL,
+ VAR_MOUSED_PORT "=/dev/cuaa1" },
+ { "COM3", "Serial mouse on COM3 (/dev/cuaa2)",
+ dmenuVarCheck, dmenuSetVariable, NULL,
+ VAR_MOUSED_PORT "=/dev/cuaa2" },
+ { "COM4", "Serial mouse on COM4 (/dev/cuaa3)",
+ dmenuVarCheck, dmenuSetVariable, NULL,
+ VAR_MOUSED_PORT "=/dev/cuaa3" },
+ { "BusMouse", "Logitech, ATI or MS bus mouse (/dev/mse0)",
+ dmenuVarCheck, dmenuSetVariable, NULL,
+ VAR_MOUSED_PORT "=/dev/mse0" },
+ { "PS/2", "PS/2 style mouse (must enable /dev/psm0)",
+ dmenuVarCheck, dmenuSetVariable, NULL,
+ VAR_MOUSED_PORT "=/dev/psm0" },
+ { NULL } },
+};
+
+DMenu MenuMouse = {
+ DMENU_NORMAL_TYPE,
+ "Please configure your mouse",
"There are many different types of mice currently on the market,\n"
"but this configuration menu should at least narrow down the choices\n"
- "somewhat. Once you've selected one of the below, you can specify\n"
- "/dev/mouse as your mouse device when running the X configuration\n"
- "utility (see Configuration menu). Please note that for PS/2 mice,\n"
- "you need to enable the psm driver in the kernel configuration menu\n"
- "when installing for the first time.",
- "For more information, visit the Documentation menu",
+ "somewhat. Once you've done with the following menus, you can specify\n"
+ "\"/dev/sysmouse\" as your mouse device and \"SysMouse\" or \"MouseSystems\"\n"
+ "as mouse protocol when running the X configuration utility (see \n"
+ "Configuration menu).",
+ "Choose 3 after selecting a protocol and a port.",
NULL,
- { { "COM1", "Serial mouse on COM1", whichMouse, dmenuSystemCommand, NULL,
- "ln -fs /dev/cuaa0 /dev/mouse", '(', '*', ')', 1 },
- { "COM2", "Serial mouse on COM2", whichMouse, dmenuSystemCommand, NULL,
- "ln -fs /dev/cuaa1 /dev/mouse", '(', '*', ')', 1 },
- { "COM3", "Serial mouse on COM3", whichMouse, dmenuSystemCommand, NULL,
- "ln -fs /dev/cuaa2 /dev/mouse", '(', '*', ')', 1 },
- { "COM4", "Serial mouse on COM4", whichMouse, dmenuSystemCommand, NULL,
- "ln -fs /dev/cuaa3 /dev/mouse", '(', '*', ')', 1 },
- { "BusMouse", "Logitech or ATI bus mouse", whichMouse, dmenuSystemCommand, NULL,
- "ln -fs /dev/mse0 /dev/mouse", '(', '*', ')', 1 },
- { "PS/2", "PS/2 style mouse (must enable psm0 device)", whichMouse, dmenuSystemCommand, NULL,
- "ln -fs /dev/psm0 /dev/mouse", '(', '*', ')', 1 },
+ { { "1 Type", "Select mouse protocol",
+ NULL, dmenuSubmenu, NULL, &MenuMouseType },
+ { "2 Port", "Select mouse port",
+ NULL, dmenuSubmenu, NULL, &MenuMousePort },
+ { "3 Daemon", "Test and run the mouse daemon",
+ NULL, mousedTest, NULL, NULL },
+ { "4 No mouse", "Clear mouse configuration",
+ NULL, dmenuSetVariables, NULL,
+ VAR_MOUSED "=NO, " VAR_MOUSED_TYPE "=NO, " VAR_MOUSED_PORT "=" },
+ { "0 Exit", "Exit this menu (returning to previous)",
+ NULL, dmenuExit },
{ NULL } },
};
@@ -1097,7 +1141,7 @@ DMenu MenuConfigure = {
NULL, dmenuSystemCommand, NULL, "tzsetup" },
{ "4 Media", "Change the installation media type",
NULL, dmenuSubmenu, NULL, &MenuMedia },
- { "5 Mouse", "Select the type of mouse you have",
+ { "5 Mouse", "Configure your mouse",
NULL, dmenuSubmenu, NULL, &MenuMouse, NULL },
{ "6 Networking", "Configure additional network services",
NULL, dmenuSubmenu, NULL, &MenuNetworking },
OpenPOWER on IntegriCloud