Mouse emulation (cut&paste via keyboard)

Mouse emulation (cut&paste via keyboard)

Post by Riku Saikkon » Sat, 11 Nov 1995 04:00:00



Would it be possible to emulate a mouse with keyboard commands?

I'm thinking of selection-like cut&paste across VCs for those who don't
have, or don't want to use, a mouse. Something like pressing a specific
keyboard key or key combination to activate `mouse mode', where the arrow
keys would move the pointer and some keys would serve as mouse buttons. Then
deactivate mouse mode with another key.

That could be a nice feature, but I'm not quite sure how to implement it. It
seems that it would require quite a bit of fiddling around with the keyboard
driver, since, in `mouse mode', it should pass some keys to some place where
gpm or selection could read them instead of the normal keyboard buffer.
Perhaps requiring a special device or something.

Any ideas? Is this implemented somewhere already?

--

"When winter first begins to bite / and stones crack in the frosty night, /
when pools are black and trees are bare, / 'tis evil in the Wild to fare."
 - J.R.R. Tolkien

 
 
 

Mouse emulation (cut&paste via keyboard)

Post by Andries Brouw » Sun, 12 Nov 1995 04:00:00


: Would it be possible to emulate a mouse with keyboard commands?

Of course.

: I'm thinking of selection-like cut&paste across VCs for those who don't
: have, or don't want to use, a mouse. Something like pressing a specific
: keyboard key or key combination to activate `mouse mode', where the arrow
: keys would move the pointer and some keys would serve as mouse buttons. Then
: deactivate mouse mode with another key.

: That could be a nice feature, but I'm not quite sure how to implement it.

Stage 1. Invent actions to be bound to keys, like
        LeftMouseButtonDown, MiddleMouseButtonDown, RightMouseButtonDown,
        LeftMouseButtonUp, MiddleMouseButtonUp, RightMouseButtonUp,
        MouseRight, MouseLeft, MouseUp, MouseDown
 A user can bind these actions to his favourite keys, say to keypad 1,2,3,7,8,9
 and the four arrow keys, on the Alt keymap.

Stage 2. Invent a mechanism to get these keypresses to selection or gpm
 while other keypresses go to the current application that reads the keyboard.
 Probably the cleanest way of doing this would involve creating a new device
 /dev/kbdmouse, that would receive console mouse actions, while other characters
 go to /dev/console. Maybe one could also convince X to work with this device.

[I might implement this if there is sufficient interest and nobody comes
with a better design. So far I got two emails with a similar request.]

 
 
 

Mouse emulation (cut&paste via keyboard)

Post by Markus Gutsch » Mon, 13 Nov 1995 04:00:00



> Stage 2. Invent a mechanism to get these keypresses to selection or gpm
>  while other keypresses go to the current application that reads the keyboard.
>  Probably the cleanest way of doing this would involve creating a new device
>  /dev/kbdmouse, that would receive console mouse actions, while other characters
>  go to /dev/console. Maybe one could also convince X to work with this device.

I believe, the cleanest design would require gpm to be a kernel
loadable module (the author already announced that he intends to do
this some time, but apparently it is not yet available). Then you
could add a new function to drivers/char/keyboard.c. This function
would allow a modules to (un)register a callback that is to be invoked
when mouse related keypresses are detected. These keypresses should be
assigned by making appropriate entries in
drivers/char/defkeymap.map. Actually, once gpm is a module, these
patches should be *very* simple! Convincing X to use this feature
would follow automagically by using gpm's redirect option!

Markus

 
 
 

1. CDE & MOUSE: *must* disable "pasting" via-mouse (GD MFing ShEing MOUSE!)

This GD mouse is driving me crazy, even causing disasters.

I do the internet via a shell-acct, connetcted to via
a dtterm and kermit.

I often use the mouse to "blacken" some text from the
internet, hit the "copy" key, hit the "front" key to get
emacs in front of me, and then either "y" (or hit the
"paste" key), thus inserting that grabbed-text into
an emacs buffer.

Wonderful -- works fine.

Except if my fingers slip on the mouse (which I am usually
*not* holding) and instead of doing a "copy", it somehow
ends doing some horrendously-long "paste" of who knows
what --

and usually at that point  I'm in either mutt, reading mail,
deleting spam, etc, or in trn browsing newsgroups --

and all that inserted garbage invariably contains plenty
of things that look like commands to that program,
and the screen shows trn or mutt just doing all kind
of horrible things -- in mutt, it's unrecoverable (with
trn, you can go back to the prior .newsrc, doing which
has its own set of problems.)

Anyway, this happens way too often (well, once is too
often), and the only fix I can think of is to disable
the ability to "paste" via a mouse-click (leaving me
the paste-key for that).

There seems to be a jillion of these .dt* files that
let you change one thing or another.

Is there a way to disable the paste-part of the mouse's
behavior?

(I sure hope so!)

Thank you!

David

2. More detail for my pppd log, PPPD seems Okay, but No ping work!

3. lost cut/paste function via mouse

4. XF86Config file for a Toshiba T2130CS

5. Cut and paste & Mouse button questions

6. Starting roaring penguin when not root user

7. Cut & Paste w/ PS/2 Mouse - HOW???

8. Perl script in C wrapper won't suid

9. Xfree cut & paste in vi /w mouse

10. PS/2 mouse does not cut & paste

11. mouse - cut & paste

12. selection - mouse cut&paste problem

13. Cut & Paste Without Mouse in Console