###############################################################################
# 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-2025 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://brltty.app/
#
# This software is maintained by Dave Mielke <dave@mielke.cc>.
###############################################################################

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

bind Thumb1+Thumb4 TIME

bind RoutingKey ROUTE:COLOR

bind Thumb1 FWINLT
bind Thumb4 FWINRT
bind Thumb2 LNUP
bind Thumb3 LNDN

bind Thumb1+Thumb2 TOP_LEFT
bind Thumb1+Thumb3 BOT_LEFT
bind Thumb4+Thumb2 TOP
bind Thumb4+Thumb3 BOT

bind Up KEY_CURSOR_UP
bind Down KEY_CURSOR_DOWN

bind Left BACK
bind Right HOME
bind Left+Right CSRTRK

bind Left+Up DISPMD
bind Left+Down SIXDOTS
bind Right+Up AUTOREPEAT
bind Right+Down AUTOSPEAK

assign chord Thumb2+
include ../chords.kti

bind Thumb1+RoutingKey CLIP_NEW
bind Thumb2+RoutingKey CLIP_ADD
bind Thumb3+RoutingKey COPY_LINE
bind Thumb4+RoutingKey COPY_RECT
bind RoutingKey+!RoutingKey CLIP_COPY
bind Thumb2+Thumb3 PASTE:PASTE_ALTMODE

bind Thumb1+Up ATTRUP
bind Thumb1+Down ATTRDN
bind Thumb2+Up PRDIFLN
bind Thumb2+Down NXDIFLN
bind Thumb3+Up PRPROMPT
bind Thumb3+Down NXPROMPT
bind Thumb4+Up PRPGRPH
bind Thumb4+Down NXPGRPH

bind Thumb1+Left PRSEARCH
bind Thumb1+Right NXSEARCH
bind Thumb2+Left FWINLTSKIP
bind Thumb2+Right FWINRTSKIP
bind Thumb3+Left CHRLT
bind Thumb3+Right CHRRT
bind Thumb4+Left LNBEG
bind Thumb4+Right LNEND

Bind Left+RoutingKey SETLEFT
Bind Right+RoutingKey DESCCHAR
bind Up+RoutingKey SWITCHVT
bind Down+RoutingKey KEY_FUNCTION

bind Thumb1+Thumb2+RoutingKey PRINDENT
bind Thumb1+Thumb3+RoutingKey NXINDENT
bind Thumb4+Thumb2+RoutingKey PRDIFCHAR
bind Thumb4+Thumb3+RoutingKey NXDIFCHAR

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 Thumb2 SPACE
map Thumb3 SPACE
map Left UPPER
map Right CONTROL


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

context menu

bind Thumb2 MENU_PREV_ITEM
bind Thumb3 MENU_NEXT_ITEM

bind Up MENU_FIRST_ITEM
bind Down MENU_LAST_ITEM

bind Left MENU_PREV_SETTING
bind Right MENU_NEXT_SETTING

bind Left+Right PREFMENU
bind Left+Up PREFLOAD
bind Left+Down PREFSAVE
