$Id: README 85 2008-01-02 01:57:37Z kostix $
"Unixkeys" -- plugin for Tkabber.


I. The idea

This plugins adds some Unix-style keybindings to Tk widgets of
class Text -- those that are used for chat input windows in
Tkabber.

The text "Unix-style" is vague, so more precisely it stands for
something like "resembles default keybindings of Emacs text
editor and Readline library". That is, these keybindings should
be familiar to those using bash and Emacs. See the next section
for complete listing of keybindings.


II. Usage

After this plugin is loaded by Tkabber, the keybindings it
provides are available in all Tkabber's widgets of type "Text"
(i.e. all multiline text editing controls).

The keybindings added are:

* M-a -- move cursor to the start of text.
* M-e -- move cursor to the end of text (but see below).

* M-f -- move cursor one word forward.
* M-b -- move cursor one word backward.

* C-u -- delete text from the cursor to the beginning of the
         current line.

* M-BackSpace, C-w -- delete text from the cursor to the start
                      of the current word.

* M-BackSpace, M-d -- delete text from the cursor to the end
                      of the current word.

* C-x C-u -- Undo the last change.

* C-x h -- Select all text.

Also, on Windows, another keybinding is added:

* C-_ (Ctrl-Underscore) -- Undo the last change.

And, finally, one convenience binding is added (this one is
borrowed from Tk list widget):

* C-\ (Ctrl-backslash) -- Select all text.


Since Tk text widgets already provide some Unix-style bindings,
we can summarise the "complete Unix-style editing" capabilities
which those widgets provide in concert with this plugin:

* C-f, C-b -- move cursor one character forward/backward.

* M-f, M-b -- move cursor one word forward/backward.

* C-a, C-e -- move cursor to the start/end of the current line.

* M-a, M-e -- move cursor to the start/end of text.

* C-h, C-d -- delete one character to the left/right from
              the cursor.

* C-w, M-BackSpace -- delete text to the start of the current
                      word.

* M-d, M-Delete -- delete text to the end of the current word.

* C-u, C-k -- delete text from the cursor to the start/end of
              the current line.

* C-x C-u, C-_, C-z -- Undo the last change.

* C-\, C-x h -- Select all text.


III. Configuration.

No configuration is needed except for one issue explained below.

The built-in Tkabber plugin providing support for emoticons
binds its action "show menu with available emoticons" to M-e
(<Alt-Key-e> and <Meta-Key-e>) in chat input windows thus
effectively cancelling the effect of pressing M-e which this
plugin adds.

If you prefer M-e to be used for cursor motion as provided by
this plugin, add something like construct in the postload
section of your config.tcl:

foreach b [event info <<EmoticonsMenu>>] {
	event delete <<EmoticonsMenu>> $b
}

This will unbind *all* bindings from the Tk virtual event that
shows the emoticons palette, effectivly disabling its usage.
If you want to access this palette via some other gesture, add
it like this, for instance:

event add <<EmoticonsMenu>> <F10>

This will made the emoticons palette to pop up when you press
<F10> on your keyboard.


IV. Limitations.

The bindings provided work only in multiline edit controls, they
won't work in one-line edit controls (entry boxes).

The bindings do not match *exactly* the behaviours of software
they borrow from. For example, M-e in Emacs stands for "end of
sentence", not "end of text in the buffer" as this plugin does.

The plugin requires special tweaking to get M-e working, as
described above.


# vim:tw=64:noet
