Skip to content

Commit

Permalink
add a dvorak keyboard layout and the ability to switch between layout…
Browse files Browse the repository at this point in the history
  • Loading branch information
rain-1 committed Jan 31, 2019
1 parent 18fe80c commit 7ab949b
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 4 deletions.
1 change: 1 addition & 0 deletions corestage2.fs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ variable bcd?

enable-interrupts
initialize-floppy
QWERTY setxkmap

require @user.fs

Expand Down
43 changes: 39 additions & 4 deletions kernel/keyboard.fs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ end-enum
: end. tblsize 256 swap - zallot ;


CREATE TBLSC
CREATE TBLSC-QWERTY
( )
( ) 0 c, ESC c,
( ) | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = BACK c,
Expand All @@ -143,9 +143,9 @@ CREATE TBLSC
( )
( ) TBLSC-SPECIAL
( )
TBLSC END.
TBLSC-QWERTY END.

CREATE TBLSC-SHIFT
CREATE TBLSC-QWERTY-SHIFT
( )
( ) 0 c, ESC c,
( ) | ! | @ | # | $ | % | ^ | & | * | ( | ) | _ | + BACK c,
Expand All @@ -156,8 +156,43 @@ CREATE TBLSC-SHIFT
( )
( ) TBLSC-SPECIAL
( )
TBLSC-SHIFT END.
TBLSC-QWERTY-SHIFT END.

CREATE TBLSC-DVORAK
( )
( ) 0 c, ESC c,
( ) | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | [ | ] BACK c,
( ) TAB c, | ' | , | . | p | y | f | g | c | r | l | / | = RET c,
( ) CTRL c, | a | o | e | u | i | d | h | t | n | s | - | \
( ) SHIFT c, | ; | ; | q | j | k | x | b | m | w | v | z SHIFT c,
( ) PRSCR c, ALT c, ______SPACE______ c, CAPSLOCK c,
( )
( ) TBLSC-SPECIAL
( )
TBLSC-DVORAK END.

CREATE TBLSC-DVORAK-SHIFT
( )
( ) 0 c, ESC c,
( ) | ! | @ | # | $ | % | ^ | & | * | ( | ) | _ | + BACK c,
( ) TAB c, | " | < | > | P | Y | F | G | C | R | L | ? | + RET c,
( ) CTRL c, | A | O | E | U | I | D | H | T | N | S | _ | |
( ) SHIFT c, | : | : | Q | J | K | X | B | M | W | V | Z SHIFT c,
( ) PRSCR c, ALT c, ______SPACE______ c, CAPSLOCK c,
( )
( ) TBLSC-SPECIAL
( )
TBLSC-DVORAK-SHIFT END.

: QWERTY ['] TBLSC-QWERTY ['] TBLSC-QWERTY-SHIFT ;
: DVORAK ['] TBLSC-DVORAK ['] TBLSC-DVORAK-SHIFT ;

DEFER TBLSC
DEFER TBLSC-SHIFT

: setxkmap ( tblsc-addr tblsc-shift-addr )
IS TBLSC-SHIFT
IS TBLSC ;

variable alt-level
variable ctrl-level
Expand Down

0 comments on commit 7ab949b

Please sign in to comment.