diff --git a/dix/inpututils.c b/dix/inpututils.c
index c51c83547..a36d88503 100644
--- a/dix/inpututils.c
+++ b/dix/inpututils.c
@@ -124,10 +124,10 @@ ApplyPointerMapping(DeviceIntPtr dev, CARD8 *map, int len, ClientPtr client)
return Success;
}
-/* Check if a modifier map change is okay with the device.
- * Returns -1 for BadValue, as it collides with MappingBusy; this particular
- * caveat can be removed with LegalModifier, as we have no other reason to
- * set MappingFailed. Sigh. */
+/* Check if a modifier map change is okay with the device. Negative return
+ * values mean BadValue, positive values mean Mapping{Busy,Failed}, 0 is
+ * Success / MappingSuccess.
+ */
static int
check_modmap_change(ClientPtr client, DeviceIntPtr dev, KeyCode *modmap)
{
@@ -153,12 +153,6 @@ check_modmap_change(ClientPtr client, DeviceIntPtr dev, KeyCode *modmap)
return -1;
}
- /* Make sure the mapping is okay with the DDX. */
- if (!LegalModifier(i, dev)) {
- client->errorValue = i;
- return MappingFailed;
- }
-
/* None of the new modifiers may be down while we change the
* map. */
if (key_is_down(dev, i, KEY_POSTED | KEY_PROCESSED)) {
diff --git a/doc/Xserver-spec.xml b/doc/Xserver-spec.xml
index a022484ba..c89ec527c 100644
--- a/doc/Xserver-spec.xml
+++ b/doc/Xserver-spec.xml
@@ -1782,18 +1782,6 @@ maintains the client's changes to it.
The X protocol defines standard names to indicate the symbol(s)
printed on each keycap. (See X11/keysym.h)
-
-Legal modifier keys must generate both up and down transitions. When
-a client tries to change a modifier key (for instance, to make "A" the
-"Control" key), DIX calls the following routine, which should return
-TRUE if the key can be used as a modifier on the given device:
-
-
- Bool LegalModifier(key, pDev)
- unsigned int key;
- DevicePtr pDev;
-
-
@@ -4998,7 +4986,6 @@ mi and fb implementations.
InstallColormapddxScreen
IntersectmiScreen
InversemiScreen
-LegalModifierhd
LineHelpermiGC op
ListInstalledColormapsddxScreen
LookupKeyboardDevicedix
diff --git a/hw/dmx/dmxinput.c b/hw/dmx/dmxinput.c
index d201034c6..c099cf18d 100644
--- a/hw/dmx/dmxinput.c
+++ b/hw/dmx/dmxinput.c
@@ -50,15 +50,6 @@
#include "input.h"
#include "mi.h"
-/** Returns TRUE if the key is a valid modifier. For PC-class
- * keyboards, all keys can be used as modifiers, so return TRUE
- * always. */
-Bool
-LegalModifier(unsigned int key, DeviceIntPtr pDev)
-{
- return TRUE;
-}
-
/** Called from dix/main.c on each server generation to initialize
* inputs. All the work is done in dmxInputInit. \see
* dmxInputInit() */
diff --git a/hw/dmx/doc/dmx.xml b/hw/dmx/doc/dmx.xml
index f10cf79dc..1ee748440 100644
--- a/hw/dmx/doc/dmx.xml
+++ b/hw/dmx/doc/dmx.xml
@@ -1077,16 +1077,6 @@ for the device when it was registered/initialized.
-
-LegalModifier()
-
-LegalModifier() is a required DDX function that can be used to
-restrict which keys may be modifier keys. This seems to be present for
-historical reasons, so this function should simply return TRUE
-unconditionally.
-
-
-
diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c
index 8ab8c24c8..185a9a359 100644
--- a/hw/kdrive/src/kinput.c
+++ b/hw/kdrive/src/kinput.c
@@ -354,12 +354,6 @@ KdPointerProc(DeviceIntPtr pDevice, int onoff)
return BadImplementation;
}
-Bool
-LegalModifier(unsigned int key, DeviceIntPtr pDev)
-{
- return TRUE;
-}
-
static void
KdRingBell(KdKeyboardInfo * ki, int volume, int pitch, int duration)
{
diff --git a/hw/vfb/InitInput.c b/hw/vfb/InitInput.c
index 52cde72f0..2c272fad5 100644
--- a/hw/vfb/InitInput.c
+++ b/hw/vfb/InitInput.c
@@ -43,12 +43,6 @@ from The Open Group.
#include "exevents.h"
#include "extinit.h"
-Bool
-LegalModifier(unsigned int key, DeviceIntPtr pDev)
-{
- return TRUE;
-}
-
void
ProcessInputEvents(void)
{
diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c
index 80676c669..4b939000c 100644
--- a/hw/xfree86/common/xf86Events.c
+++ b/hw/xfree86/common/xf86Events.c
@@ -105,12 +105,6 @@ typedef struct x_IHRec {
static IHPtr InputHandlers = NULL;
-Bool
-LegalModifier(unsigned int key, DeviceIntPtr pDev)
-{
- return TRUE;
-}
-
/*
* TimeSinceLastInputEvent --
* Function used for screensaver purposes by the os module. Returns the
diff --git a/hw/xnest/Keyboard.c b/hw/xnest/Keyboard.c
index 85deabab4..c7af77e9b 100644
--- a/hw/xnest/Keyboard.c
+++ b/hw/xnest/Keyboard.c
@@ -217,12 +217,6 @@ xnestKeyboardProc(DeviceIntPtr pDev, int onoff)
return Success;
}
-Bool
-LegalModifier(unsigned int key, DeviceIntPtr pDev)
-{
- return TRUE;
-}
-
void
xnestUpdateModifierState(unsigned int state)
{
diff --git a/hw/xquartz/quartzKeyboard.c b/hw/xquartz/quartzKeyboard.c
index 755fe0990..6d76845ad 100644
--- a/hw/xquartz/quartzKeyboard.c
+++ b/hw/xquartz/quartzKeyboard.c
@@ -726,17 +726,6 @@ DarwinModifierStringToNXMask(const char *str, int separatelr)
return 0;
}
-/*
- * LegalModifier
- * This allows the ddx layer to prevent some keys from being remapped
- * as modifier keys.
- */
-Bool
-LegalModifier(unsigned int key, DeviceIntPtr pDev)
-{
- return 1;
-}
-
#if !defined(__LP64__) || MAC_OS_X_VERSION_MIN_REQUIRED < 1050
static inline UniChar
macroman2ucs(unsigned char c)
diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c
index 7f08b36e2..15fc989bd 100644
--- a/hw/xwayland/xwayland-input.c
+++ b/hw/xwayland/xwayland-input.c
@@ -2490,12 +2490,6 @@ static const struct wl_registry_listener input_listener = {
global_remove,
};
-Bool
-LegalModifier(unsigned int key, DeviceIntPtr pDev)
-{
- return TRUE;
-}
-
void
ProcessInputEvents(void)
{
diff --git a/hw/xwin/InitInput.c b/hw/xwin/InitInput.c
index f121d055e..04cd514ab 100644
--- a/hw/xwin/InitInput.c
+++ b/hw/xwin/InitInput.c
@@ -46,21 +46,6 @@ int winProcEstablishConnection(ClientPtr /* client */ );
DeviceIntPtr g_pwinPointer;
DeviceIntPtr g_pwinKeyboard;
-/* Called from dix/devices.c */
-/*
- * All of our keys generate up and down transition notifications,
- * so all of our keys can be used as modifiers.
- *
- * An example of a modifier is mapping the A key to the Control key.
- * A has to be a legal modifier. I think.
- */
-
-Bool
-LegalModifier(unsigned int uiKey, DeviceIntPtr pDevice)
-{
- return TRUE;
-}
-
/* Called from dix/dispatch.c */
/*
* Run through the Windows message queue(s) one more time.
diff --git a/include/input.h b/include/input.h
index 6c9e45df6..b658e9989 100644
--- a/include/input.h
+++ b/include/input.h
@@ -415,9 +415,6 @@ extern void ProcessPointerEvent(InternalEvent * /* ev */ ,
extern void ProcessKeyboardEvent(InternalEvent * /*ev */ ,
DeviceIntPtr /*keybd */ );
-extern Bool LegalModifier(unsigned int /*key */ ,
- DeviceIntPtr /*pDev */ );
-
extern _X_EXPORT void ProcessInputEvents(void);
extern _X_EXPORT void InitInput(int /*argc */ ,