Is there a way to change the selection.screen from the primary to secondary 
screen using the perl api commands or an X event? I'm working on a perl plugin 
to allow me to select text within a terminal window with a keyboard. I don't 
like using a mouse. I have a simple proof of concept working, at least within 
the primary screen, but if I open an application, vim or screen, for example, 
the selection commands (selection_beg, selection_end, etc) act on the primary 
screen. The only way I've been been able to change the selection.screen to a 
secondary screen is with a mouseclick. Once clicked the selection commands work 
as expected.

This is the code for the proof of concept plugin. Very basic. It allows one 
line to be selected. By executing the scroll_up and scroll_down commands you 
can move the selected line up or down.

    sub on_user_command {

        my ($self, $cmd) = @_;

        my ($row_beg, $col_beg) =  $self->selection_beg ();
        my ($row_end, $col_end) =  $self->selection_end ();

        if ($cmd eq "select_by_key:scroll_down") {
            $self->selection_beg( $row_beg+1, 0);
            $self->selection_end( $row_beg+2, 0);
            $self->selection_make(urxvt::CurrentTime);
        }

        if ($cmd eq "select_by_key:scroll_up") {
            $self->selection_beg( $row_beg-1, 0);
            $self->selection_end( $row_beg,   0);
            $self->selection_make(urxvt::CurrentTime);
        }

        ()
    }

Any ideas would be appreciated. Thanks.

Regards
Jim Karsten

_______________________________________________
rxvt-unicode mailing list
[email protected]
http://lists.schmorp.de/cgi-bin/mailman/listinfo/rxvt-unicode

Reply via email to