aboutsummaryrefslogtreecommitdiffstats
path: root/feature-tests/key_sig.pl
blob: 3da50acafefcab8215abf3a2b86b5cffbb7f5125 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
use strict;
use warnings 'all';

use Irssi;
use Irssi::Irc;
use Irssi::TextUI;

use Data::Dumper;


our $VERSION = '0.1';
our %IRSSI = (
              authors     => 'shabble',
              contact     => 'shabble+irssi@metavore.org',
              name        => '',
              description => '',
              license     => 'Public Domain',
             );

my $bacon = 10;

Irssi::signal_register({'key created' => [qw/Irssi::UI::Key/ ] });

Irssi::signal_add('key created', \&sig_key_created);
Irssi::signal_register({'key command' => [qw/string/]});
Irssi::signal_add_first('key command' => \&sig_key_cmd);

Irssi::signal_register({'key key' => [qw/string/]});
Irssi::signal_add_first('key key' => \&sig_key_key);

Irssi::signal_register({'key nothing' => [qw/string/]});
Irssi::signal_add_first('key nothing' => \&sig_key_nothing);

Irssi::signal_register({'keyboard created' => [qw/Irssi::UI::Keyboard/]});
Irssi::signal_add_first('keyboard created' => \&sig_keyboard);

Irssi::signal_register({'key bacon' => [qw/string int int/]});
Irssi::signal_add_first('key bacon' => \&sig_key_bacon);

sub sig_key_bacon {
    print "baconkey: " . Dumper(\@_);
}

sub sig_keyboard {
    my ($data) = @_;
    print "keyboard: " . Dumper($data);
}

sub sig_key_cmd {
    my ($data) = @_;
    print "key cmd: " . Dumper($data);

}

sub sig_key_nothing {
    my ($data) = @_;
    print "key nothing: " . Dumper($data);

}

sub sig_key_key {
    my ($data) = @_;
    print "key key: " . Dumper($data);

}

sub sig_key_created {
    my @args = @_;

    print "Key Created, Args: " . Dumper(\@args);
}

Irssi::command("bind meta-q key bacon");