Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!elroy.jpl.nasa.gov!ncar!gatech!bloom-beacon!dont-send-mail-to-path-lines From: mouse@lightning.mcrcim.mcgill.EDU Newsgroups: comp.windows.x Subject: Re: Remapping the keyboard to emulate mouse button Message-ID: <9102160610.AA26057@lightning.McRCIM.McGill.EDU> Date: 16 Feb 91 06:10:30 GMT Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 38 > [...] Therefore I would like to remap the keyboard such that one of > the keyboard buttons (the lower left [Enter] button for example) can > be used by the left hand for button1 of the mouse while the right > hand would actually move the trackball. > I looked at xmodmap but it didn't prove fruitful. Right. The core protocol does not support "confusing" keyboard keys and mouse buttons. (Arguably it should - there is no obvious a priori reason to make a distinction between buttons on the mouse and buttons on the keyboard. Most likely nobody even considered the possibility of "confusing" them....) > Any ideas out there? I think that for the most part you're out of luck. The obvious thing to do would be to hack on the server. If you can't do that for some reason you could build a protocol filter than converts KeyPress and KeyRelease events for certain keycodes into ButtonPress and ButtonRelease events. However, this will interact badly with grabs, so it is at best a somewhat broken solution. (I don't think a mere protocol filter can diddle grab requests sufficiently to fix the problem entirely.) If it's enough for this to happen in just certain applications, you may be able to do things with the Translations mechanisms, or something analogous, depending on how configurable the application is. If the hardware is yours and you're not afraid of a soldering gun, you *might* consider opening things up and rewiring a couple of keyboard key switches so they actually do mouse presses instead. That's about all I have to suggest, I'm afraid. der Mouse old: mcgill-vision!mouse new: mouse@larry.mcrcim.mcgill.edu