OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [expect/] [example/] [dvorak] - Blame information for rev 1774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
#!../expect -f
2
# simulate a dvorak keyboard
3
# Actually just the lowercase letters are mapped to show the basic idea.
4
# Really, uppercase and control should probably be mapped too.
5
# But this isn't really what expect is all about.  It just demonstrates
6
# the mapping ability of 'interact'.
7
 
8
proc rot {} {
9
        interact {
10
                q {send '}  w {send ,}  e {send .}  r {send p}
11
                t {send y}  y {send f}  u {send g}  i {send c}
12
                o {send r}  p {send l}  s {send o}  d {send e}
13
                f {send u}  g {send i}  h {send d}  j {send h}
14
                k {send t}  l {send n}  \; {send s}  ' {send -- -}
15
                z {send \;}  x {send q}  c {send j}  v {send k}
16
                b {send x}  n {send b}  , {send w}  . {send v}
17
                / {send z}  ~q {return} ~d {} ~e {}
18
                -o eof exit
19
        }
20
}
21
 
22
log_user 0
23
spawn $env(SHELL)
24
log_user 1
25
send_user "~d for dvorak input\n"
26
send_user "~q for qwerty input (default)\n"
27
send_user "~e for expect interpreter\n"
28
send_user "Enter ~ sequences using qwerty keys\n"
29
interact ~d rot ~q {} ~e

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.