## Customizing Mouse Buttons

Mouse buttons can be "remapped" in the same way as keys. The command is:

    SET MOUSE BUTTON number key-modifiers event definition

where:

number
  Is the mouse button number 1, or 2. Or 3 if your mouse has 3 buttons. This denotes which button causes the event. Normally button 1 is the left button.

key-modifier
  Tells which, if any, keys are held down during the mouse event. The possibilities are `NONE`, `ALT`, `ALT-SHIFT`, `CTRL`, `CTRL-ALT`, `CTRL-SHIFT`, `CTRL-ALT-SHIFT`, and `SHIFT`.

event
  Specifies the type of mouse event. The possibilities are: `CLICK`, `DOUBLE-CLICK`, and `DRAG`.

definition
  Is the definition for this event.

Thus, for a 2-button mouse, there are 2 x 8 x 3 = 48 distinct actions that can be assigned, and 72 for a 3-button mouse.

The definition is just like a key definition: it can be a single character, a character string, a Kverb, or any combination. Kermit 95 has hundreds of Kverbs. The following Kverbs are specifically mouse-oriented, but you can also assign other Kverbs to mouse actions:

`\Kmarkcopyclip`
  Marks and copies text to the Clipboard.

`\Kmarkcopyclip_noeol`
  Marks and copies text to the Clipboard, discarding line terminators.

`\Kpaste`
  Copies from the clipboard into the current Kermit 95 screen.

`\Kdump`
  Marks and copies text to the `SET PRINTER` device.

`\Kmarkcopyhost`
  Marks and copies text to the host.

`\Kmarkcopyhost_noeol`
  Marks and copies text to the host, discarding line terminators.

`\Kmousecurpos`
  Transmit arrow-key sequences to move terminal cursor to mouse position.

`\Kmouseurl`
  Send URL under mouse cursor to Web browser.

Examples:

`SET MOUSE BUTTON 1 CTRL CLICK \KMOUSEURL`
  This puts the "URL hot spot" function on Ctrl-Button 1 (this is the default assignment).

`SET MOUSE BUTTON 3 SHIFT DOUBLE-CLICK \KPASTE`
  Puts "paste from Clipboard" on Button 3 Shift-Double-Click.

In addition to the built-in mouse functions, you can write your own Kermit macros for processing mouse events. Kermit 95 provides three Kermit variables `\v(mousecurx)`, `\v(mousecury)`, and `\v(select)` which can be used in a macro.

The following macro starts the browser on the result of a drag event:

      define myurl run start \m(browser) \v(select), if terminal-macro connect

This can then be assigned to a mouse event with

      SET MOUSE BUTTON Button 1 Alt Drag \kmyurl

The `\v(mousecurx)` and `\v(mousecury)` represent the position of the mouse click or the end of the drag event. This can be used with the `\fscrnstr()` function to read text from the screen at that location.

In addition to remapping mouse buttons, you can configure the mouse wheel in much the same way with:

    SET MOUSE WHEEL direction key-modifiers definition

Where direction is either `UP` or `DOWN`. The rest is the same as for mouse buttons. Examples:

`SET MOUSE WHEEL UP CTRL \KUPONE`
  This makes the mouse wheel scroll up one screen when Ctrl is held down

`SET MOUSE WHEEL DOWN CTRL \KUPONE`
  This makes the mouse wheel scroll down one screen when Ctrl is held down

Use `SHOW MOUSE` to show the current mouse event assignments.

Click Back on your Browser's Toolbar to return.