… | |
… | |
137 | =over 4 |
137 | =over 4 |
138 | |
138 | |
139 | =item on_init $term |
139 | =item on_init $term |
140 | |
140 | |
141 | Called after a new terminal object has been initialized, but before |
141 | Called after a new terminal object has been initialized, but before |
142 | windows are created or the command gets run. |
142 | windows are created or the command gets run. Most methods are unsafe to |
|
|
143 | call or deliver senseless data, as terminal size and other characteristics |
|
|
144 | have not yet been determined. You can safely query and change resources, |
|
|
145 | though. |
143 | |
146 | |
144 | =item on_reset $term |
147 | =item on_reset $term |
145 | |
148 | |
146 | Called after the screen is "reset" for any reason, such as resizing or |
149 | Called after the screen is "reset" for any reason, such as resizing or |
147 | control sequences. Here is where you can react on changes to size-related |
150 | control sequences. Here is where you can react on changes to size-related |
… | |
… | |
258 | |
261 | |
259 | Called whenever the user presses a key combination that has a |
262 | Called whenever the user presses a key combination that has a |
260 | C<perl:string> action bound to it (see description of the B<keysym> |
263 | C<perl:string> action bound to it (see description of the B<keysym> |
261 | resource in the @@RXVT_NAME@@(1) manpage). |
264 | resource in the @@RXVT_NAME@@(1) manpage). |
262 | |
265 | |
|
|
266 | =item on_key_press $term, $event |
|
|
267 | |
|
|
268 | =item on_key_release $term, $event |
|
|
269 | |
|
|
270 | =item on_button_press $term, $event |
|
|
271 | |
|
|
272 | =item on_button_release $term, $event |
|
|
273 | |
|
|
274 | =item on_motion_notify $term, $event |
|
|
275 | |
|
|
276 | Called whenever the corresponding X event is received for the terminal. If |
|
|
277 | the hook returns true, then the even will be ignored by rxvt-unicode. |
|
|
278 | |
|
|
279 | subwindow. |
|
|
280 | |
263 | =back |
281 | =back |
264 | |
282 | |
265 | =head2 Variables in the C<urxvt> Package |
283 | =head2 Variables in the C<urxvt> Package |
266 | |
284 | |
267 | =over 4 |
285 | =over 4 |
… | |
… | |
274 | =back |
292 | =back |
275 | |
293 | |
276 | =head2 Functions in the C<urxvt> Package |
294 | =head2 Functions in the C<urxvt> Package |
277 | |
295 | |
278 | =over 4 |
296 | =over 4 |
|
|
297 | |
|
|
298 | =item $term = new urxvt [arg...] |
|
|
299 | |
|
|
300 | Creates a new terminal, very similar as if you had started it with |
|
|
301 | C<system $binfile, arg...>. Croaks (and probably outputs an error message) |
|
|
302 | if the new instance couldn't be created. Returns C<undef> if the new |
|
|
303 | instance didn't initialise perl, and the terminal object otherwise. The |
|
|
304 | C<init> and C<start> hooks will be called during the call. |
279 | |
305 | |
280 | =item urxvt::fatal $errormessage |
306 | =item urxvt::fatal $errormessage |
281 | |
307 | |
282 | Fatally aborts execution with the given error message. Avoid at all |
308 | Fatally aborts execution with the given error message. Avoid at all |
283 | costs! The only time this is acceptable is when the terminal process |
309 | costs! The only time this is acceptable is when the terminal process |
… | |
… | |
500 | } |
526 | } |
501 | |
527 | |
502 | =head2 The C<urxvt::term> Class |
528 | =head2 The C<urxvt::term> Class |
503 | |
529 | |
504 | =over 4 |
530 | =over 4 |
|
|
531 | |
|
|
532 | =item $term->destroy |
|
|
533 | |
|
|
534 | Destroy the terminal object (close the window, free resources etc.). |
505 | |
535 | |
506 | =item $value = $term->resource ($name[, $newval]) |
536 | =item $value = $term->resource ($name[, $newval]) |
507 | |
537 | |
508 | Returns the current resource value associated with a given name and |
538 | Returns the current resource value associated with a given name and |
509 | optionally sets a new value. Setting values is most useful in the C<init> |
539 | optionally sets a new value. Setting values is most useful in the C<init> |
… | |
… | |
650 | |
680 | |
651 | Normally its not a good idea to use this function, as programs might be |
681 | Normally its not a good idea to use this function, as programs might be |
652 | confused by changes in cursor position or scrolling. Its useful inside a |
682 | confused by changes in cursor position or scrolling. Its useful inside a |
653 | C<on_add_lines> hook, though. |
683 | C<on_add_lines> hook, though. |
654 | |
684 | |
|
|
685 | =item $term->cmd_parse ($octets) |
|
|
686 | |
|
|
687 | Similar to C<scr_add_lines>, but the argument must be in the |
|
|
688 | locale-specific encoding of the terminal and can contain command sequences |
|
|
689 | (escape codes) that will be interpreted. |
|
|
690 | |
655 | =item $term->tt_write ($octets) |
691 | =item $term->tt_write ($octets) |
656 | |
692 | |
657 | Write the octets given in C<$data> to the tty (i.e. as program input). To |
693 | Write the octets given in C<$data> to the tty (i.e. as program input). To |
658 | pass characters instead of octets, you should convert your strings first |
694 | pass characters instead of octets, you should convert your strings first |
659 | to the locale-specific encoding using C<< $term->locale_encode >>. |
695 | to the locale-specific encoding using C<< $term->locale_encode >>. |