Topic: Scripting

Topic: Scripting

Scripting help hehe

Table 4.15. Subtopics

Events

Events

Everytime an event occurs a perl function is called. This is done
by a function reference which you can change to point to your
own piece of code. There are basically four events:

  - $onTimer gets no parameter and is called 4 times a second.
  - $onTextEntered gets the text entered at the input line and
    is called whenever enter is pressed. If you overwrite this, you have to
    implement evaluation of perl code for lines starting with # by yourself.
  - $onKeyPressed gets a string containing the currently
    pressed modifiers and the key's name as argument and is called everytime
    a key is pressed. Returns true if it reacted on the key, false otherwise.
  - $onTextReceived get a string containing a bunch of lines
    that came from the server. Ansi-Escape codes are still in there so
    be carefull with your regexps (espacially ^ can't be used if there's
    colored text at the beginning of the line). If you reimplement this,
    make sure that all interesting output will be written to some window.

You can overwrite one of the hooks simply by specifying
$onHook = sub { my $some = shift; blah blah ... };

Now all you have to know is how to generate windows and how
to put text into these windows before you can do anything you'll
ever want (hopefully :). 

See the help on the window classes.

KDE Logo