release 1.08.2
[descalc.git] / DCT / Bindings.pm
1 # key bindings for DCT, by Shiar
2
3 # 1.08.1 2004-09-27 00:40 - moved from 1.8 main
4 # 1.08.2 2004-09-27 00:49 - single key alias to chs: \ (often close to _)
5
6 package DCT::Bindings;
7
8 use strict;
9 use utf8;
10
11 use vars qw($VERSION @ISA @EXPORT);
12 require Exporter;
13
14 @ISA = qw(Exporter);
15 @EXPORT = qw(%falias %alias);
16
17 $VERSION = 1.008.001;
18
19 our %falias = (
20         "\033"                         =>  0, # esc
21         "\033\117\120"                 =>  1, # f1
22         "\033\133\061\061\176"         =>  1, # f1
23         "\033\133\061\062\176"         =>  2, # f2
24         "\033\133\061\063\176"         =>  3, # f3
25         "\033\133\061\064\176"         =>  4, # f4
26         "\033\117\121"                 =>  2, # f2
27         "\033\117\122"                 =>  3, # f3
28         "\033\117\123"                 =>  4, # f4
29         "\033\133\061\065\176"         =>  5, # f5
30         "\033\133\061\067\176"         =>  6, # f6
31         "\033\133\061\070\176"         =>  7, # f7
32         "\033\133\061\071\176"         =>  8, # f8
33         "\033\133\062\060\176"         =>  9, # f9
34         "\033\133\062\061\176"         => 10, # f10
35         "\033\133\062\063\176"         => 11, # f11/F1
36         "\033\133\062\064\176"         => 12, # f12/F2
37         "\033\133\062\065\176"         => 13, # F3
38         "\033\133\062\066\176"         => 14, # F4
39         "\033\133\062\070\176"         => 15, # F5
40         "\033\133\062\071\176"         => 16, # F6
41         "\033\133\063\061\176"         => 17, # F7
42         "\033\133\063\062\176"         => 18, # F8
43         "\033\133\063\063\176"         => 19, # F9
44         "\033\133\063\064\176"         => 20, # F10
45         "\033\133\062\063\073\062\176" => 21, # F11
46         "\033\133\062\064\073\062\176" => 22, # F12
47 ); # %falias
48
49 our %alias = (
50         chr 4              => 'quit',    # ^D
51         chr 9              => 'more',    # tab
52         "\014"             => 'refresh', # ^L
53 #       "\033\133\110"     => 'refresh', # home
54         '_'                => 'chs',     # easy to remember, difficult to type
55         '\\'               => 'chs',     # single key
56 #       'y'                => 'chs',     # redundant hp48 compatibility
57 #       'z'                => 'eex',     # redundant hp48 compatibility
58         "\033\133\062\176" => 'eex',     # ins
59         "\033\133\063\176" => "clear",   # del
60         chr 127            => 'drop',    # backspace
61         chr 8              => 'drop',    # backspace
62         chr 13             => 'enter',   # enter
63         ' '                => 'enter',   # space
64         '='                => 'sto',     #
65
66         "\033\133\101"     => 'stack',   # up    - 48: k (stack)
67         "\033\133\104"     => 'undo',    # left  - 48: p (picture)
68 #       "\033\133\102"     => '',        # down  - 48: q (view)
69         "\033\133\103"     => 'swap',    # right - 48: r (swap)
70
71         '&'                => 'and',
72         '|'                => 'or',
73         '#'                => 'xor',
74         '~'                => 'not',
75         '('                => 'sl',
76         ')'                => 'sr',
77
78             "s"            => "sin",
79         "\033s"            => "asin",
80             "c"            => "cos", #todo: u? o?
81         "\033c"            => "acos",
82             "t"            => "tan",
83         "\033t"            => "atan",
84             "l"            => "log",
85         "\033l"            => "alog",
86             "n"            => "ln",
87         "\033n"            => "exp",
88             "q"            => "sq",
89         "\033q"            => "sqrt",
90             "x"            => "^",
91         "\033x"            => "xroot",
92         "\033^"            => "xroot",
93             "v"            => "inv",
94 ); # %alias
95
96 1;
97