###############################################################################
# BRLTTY - A background process providing access to the console screen (when in
#          text mode) for a blind person using a refreshable braille display.
#
# Copyright (C) 1995-2012 by The BRLTTY Developers.
#
# BRLTTY comes with ABSOLUTELY NO WARRANTY.
#
# This is free software, placed under the terms of the
# GNU Lesser General Public License, as published by the Free Software
# Foundation; either version 2.1 of the License, or (at your option) any
# later version. Please see the file LICENSE-LGPL for details.
#
# Web Page: http://mielke.cc/brltty/
#
# This software is maintained by Dave Mielke <dave@mielke.cc>.
###############################################################################

title Alva Braille Controller [6nn]

note The four keys at the ends of the text cell area are named ETouch:
note * Each is subnamed according to the side its on (Left, Right),
note * and according to its position on that side (Rear, Front).
note The nine-key pad in front of the text cell area is named Smartpad:
note * Its center key is subnamed Enter.
note * Its four inner keys are subnamed Left, Right, Up, and Down.
note * The two long keys on its left are subnamed F1 and F2.
note * The two long keys on its right are subnamed F3 and F4.
note The five keys on the front are named Thumb:
note * From left to right, they're subnamed: Left, Up, Home, Down, Right.


####################
# Default Bindings #
####################

bind ETouchLeftRear+ETouchRightRear HELP
bind ETouchLeftRear+ETouchRightFront LEARN
bind ETouchLeftFront+ETouchRightRear INFO
bind ETouchLeftFront+ETouchRightFront PREFMENU

bind ThumbUp+ThumbDown CSRTRK
bind ThumbHome HOME
bind ETouchLeftRear+ETouchLeftFront BACK

bind ThumbUp LNUP
bind ThumbDown LNDN
bind ThumbLeft FWINLT
bind ThumbRight FWINRT

bind ThumbHome+ThumbUp PRDIFLN
bind ThumbHome+ThumbDown NXDIFLN
bind ThumbHome+ThumbLeft FWINLTSKIP
bind ThumbHome+ThumbRight FWINRTSKIP

bind ThumbLeft+ThumbUp TOP_LEFT
bind ThumbLeft+ThumbDown BOT_LEFT
bind ThumbRight+ThumbUp ATTRUP
bind ThumbRight+ThumbDown ATTRDN

bind ThumbHome+ETouchLeftRear PRPROMPT
bind ThumbHome+ETouchLeftFront NXPROMPT
bind ThumbHome+ETouchRightRear PRPGRPH
bind ThumbHome+ETouchRightFront NXPGRPH

bind ETouchLeftRear LNBEG
bind ETouchRightRear LNEND
bind ETouchLeftFront CHRLT
bind ETouchRightFront CHRRT

bind RoutingKey1 ROUTE
bind ETouchRightRear+ETouchRightFront CSRJMP_VERT

bind RoutingKey1+!RoutingKey1 CLIP_COPY
bind ThumbLeft+!RoutingKey1 CLIP_NEW
bind ThumbUp+!RoutingKey1 CLIP_ADD
bind ThumbDown+!RoutingKey1 COPY_RECT
bind ThumbRight+!RoutingKey1 COPY_LINE
bind ThumbLeft+ThumbRight PASTE

bind !RoutingKey2 DESCCHAR
bind ThumbUp+!RoutingKey2 PRINDENT
bind ThumbDown+!RoutingKey2 NXINDENT
bind ThumbLeft+!RoutingKey2 PRDIFCHAR
bind ThumbRight+!RoutingKey2 NXDIFCHAR

bind ThumbHome+!RoutingKey1 SETLEFT

bind ThumbLeft+ETouchLeftRear CSRVIS
bind ThumbLeft+ETouchLeftFront ATTRVIS
bind ThumbLeft+ETouchRightFront SIXDOTS
bind ThumbUp+ETouchLeftRear FREEZE
bind ThumbUp+ETouchLeftFront DISPMD

bind SmartpadLeft KEY_CURSOR_LEFT
bind SmartpadRight KEY_CURSOR_RIGHT
bind SmartpadUp KEY_CURSOR_UP
bind SmartpadDown KEY_CURSOR_DOWN
bind SmartpadEnter PASTE

bind SmartpadF1+SmartpadLeft SWITCHVT_PREV
bind SmartpadF1+SmartpadRight SWITCHVT_NEXT
bind SmartpadF1+SmartpadEnter KEY_INSERT
bind SmartpadF1+!RoutingKey1 SWITCHVT

bind SmartpadF2+SmartpadUp KEY_PAGE_UP
bind SmartpadF2+SmartpadDown KEY_PAGE_DOWN
bind SmartpadF2+SmartpadLeft KEY_HOME
bind SmartpadF2+SmartpadRight KEY_END
bind SmartpadF2+SmartpadEnter KEY_DELETE
bind SmartpadF2+!RoutingKey1 KEY_FUNCTION

bind SmartpadF3+SmartpadLeft MUTE
bind SmartpadF3+SmartpadRight SAY_LINE
bind SmartpadF3+SmartpadUp SAY_ABOVE
bind SmartpadF3+SmartpadDown SAY_BELOW
bind SmartpadF3+SmartpadEnter SPKHOME

bind SmartpadF4+SmartpadLeft SAY_SLOWER
bind SmartpadF4+SmartpadRight SAY_FASTER
bind SmartpadF4+SmartpadDown SAY_SOFTER
bind SmartpadF4+SmartpadUp SAY_LOUDER
bind SmartpadF4+SmartpadEnter AUTOSPEAK

map Dot1 DOT1
map Dot2 DOT2
map Dot3 DOT3
map Dot4 DOT4
map Dot5 DOT5
map Dot6 DOT6
map Dot7 DOT7
map Dot8 DOT8
map Space SPACE
map Control CONTROL
map Alt META
bind Enter KEY_ENTER

bind Space+Dot3 KEY_CURSOR_LEFT
bind Space+Dot6 KEY_CURSOR_RIGHT
#bind Space+Dot2 KEY_WORD_LEFT
#bind Space+Dot5 KEY_WORD_RIGHT
bind Space+Dot1 KEY_CURSOR_UP
bind Space+Dot4 KEY_CURSOR_DOWN
bind Space+Dot1+Dot3 KEY_PAGE_UP
bind Space+Dot4+Dot6 KEY_PAGE_DOWN
bind Space+Dot1+Dot2+Dot3 KEY_HOME
bind Space+Dot4+Dot5+Dot6 KEY_END
bind Space+Dot4+Dot5 KEY_DELETE
bind Space+Dot5+Dot6 KEY_TAB

bind Space+Dot1+Dot2 KEY_BACKSPACE
#bind Space+Dot1+Dot4 KEY_CAPSLOCK
bind Space+Dot1+Dot5 KEY_ESCAPE
bind Space+Dot2+Dot4 KEY_INSERT
#bind Space+Dot1+Dot3+Dot6 KEY_NUMLOCK

bind Space+Dot3+Dot7 KEY_CURSOR_LEFT+shift
bind Space+Dot6+Dot7 KEY_CURSOR_RIGHT+shift
bind Space+Dot1+Dot7 KEY_CURSOR_UP+shift
bind Space+Dot4+Dot7 KEY_CURSOR_DOWN+shift
bind Space+Dot1+Dot3+Dot7 KEY_PAGE_UP+shift
bind Space+Dot4+Dot6+Dot7 KEY_PAGE_DOWN+shift
bind Space+Dot1+Dot2+Dot3+Dot7 KEY_HOME+shift
bind Space+Dot4+Dot5+Dot6+Dot7 KEY_END+shift
bind Space+Dot4+Dot5+Dot7 KEY_DELETE+shift
bind Space+Dot2+Dot3 KEY_TAB+shift
bind Space+Dot7 PASSCHAR+\s+shift

bind Space+Dot1+Dot5+Dot7 KEY_ESCAPE+shift


#################
# Menu Bindings #
#################

context menu

bind ThumbLeft FWINLT
bind ThumbRight FWINRT
bind ThumbUp MENU_PREV_ITEM
bind ThumbDown MENU_NEXT_ITEM
bind ETouchLeftRear MENU_FIRST_ITEM
bind ETouchLeftFront MENU_LAST_ITEM
bind ETouchRightRear MENU_PREV_SETTING
bind ETouchRightFront MENU_NEXT_SETTING

bind ThumbHome PREFMENU
bind ETouchLeftRear+ETouchLeftFront PREFLOAD
bind ETouchRightRear+ETouchRightFront PREFSAVE

bind SmartpadF1 PREFMENU
bind SmartpadF2 PREFLOAD
bind SmartpadUp MENU_PREV_ITEM
bind SmartpadDown MENU_NEXT_ITEM
bind SmartpadLeft MENU_PREV_SETTING
bind SmartpadRight MENU_NEXT_SETTING
bind SmartpadEnter PREFSAVE


