###############################################################################
# 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-2014 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+on
bind ThumbDown+!ThumbUp CSRTRK+off
bind ThumbHome RETURN
bind ThumbLeft+ThumbRight CSRJMP_VERT

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 ETouchLeftRear+ThumbUp PRPROMPT
bind ETouchLeftRear+ThumbDown NXPROMPT
bind ETouchLeftFront+ThumbUp PRPGRPH
bind ETouchLeftFront+ThumbDown NXPGRPH
bind ETouchRightRear+ThumbUp PRSEARCH
bind ETouchRightRear+ThumbDown NXSEARCH

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

bind RoutingKey1 ROUTE

bind ETouchLeftRear+ETouchLeftFront+RoutingKey1 DESCCHAR
bind RoutingKey1+!RoutingKey1 CLIP_COPY
bind ETouchLeftRear+RoutingKey1 CLIP_NEW
bind ETouchLeftFront+RoutingKey1 CLIP_ADD
bind ETouchRightRear+RoutingKey1 COPY_LINE
bind ETouchRightFront+RoutingKey1 COPY_RECT
bind ETouchRightRear+ETouchRightFront PASTE

bind ThumbLeft+RoutingKey1 PRINDENT
bind ThumbRight+RoutingKey1 NXINDENT
bind ThumbUp+RoutingKey1 PRDIFCHAR
bind ThumbDown+RoutingKey1 NXDIFCHAR
bind ThumbHome+RoutingKey1 SETLEFT

bind ETouchLeftRear+ETouchLeftFront+ETouchRightRear FREEZE
bind ETouchLeftRear+ETouchRightRear+ETouchRightFront DISPMD

bind ThumbLeft+ETouchLeftRear CSRVIS
bind ThumbLeft+ETouchLeftFront ATTRVIS
bind ThumbLeft+ETouchRightFront SIXDOTS

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

bind SmartpadF2 TIME

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+SmartpadF4 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

bind SmartpadF1+SmartpadF2+SmartpadEnter RESTARTBRL
bind SmartpadF3+SmartpadF4+SmartpadEnter RESTARTSPEECH

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

assign chord Space+
include brl-chords.kti


#################
# 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


