mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Put bindings in defaultKeyBindings() to site.bind
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21268 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
325da0a915
commit
7fb4a57ab9
@ -2669,6 +2669,7 @@ lib_bind_files = Split('''
|
||||
math.bind
|
||||
menus.bind
|
||||
sciword.bind
|
||||
site.bind
|
||||
xemacs.bind
|
||||
''')
|
||||
|
||||
|
@ -61,6 +61,7 @@ dist_bind_DATA = \
|
||||
bind/math.bind \
|
||||
bind/menus.bind \
|
||||
bind/sciword.bind \
|
||||
bind/site.bind \
|
||||
bind/xemacs.bind \
|
||||
bind/aqua.bind
|
||||
|
||||
|
50
lib/bind/site.bind
Normal file
50
lib/bind/site.bind
Normal file
@ -0,0 +1,50 @@
|
||||
# -*- text -*-
|
||||
|
||||
# file cua.bind
|
||||
# This file is part of LyX, the document processor.
|
||||
# Licence details can be found in the file COPYING.
|
||||
#
|
||||
# author Alfredo Braunstein
|
||||
# author Lars Gullik Bjønnes
|
||||
# author Jean-Marc Lasgouttes
|
||||
# author John Levon
|
||||
# author André Pönitz
|
||||
|
||||
# Full author contact details are available in file CREDITS.
|
||||
|
||||
# This is the site bind file that defines essential keybindings, and
|
||||
# will always be loaded by lyx before other bind files. Package
|
||||
# maintainers can customize this file for specific platform.
|
||||
|
||||
# DO NOT CHANGE THIS DEFAULT BINDING FILE! It will be replaced
|
||||
# with every new install of LyX and your changes will be lost.
|
||||
#
|
||||
|
||||
\bind "Right" "char-right"
|
||||
\bind "Left" "char-left"
|
||||
\bind "Up" "up"
|
||||
\bind "Down" "down"
|
||||
|
||||
\bind "Tab" "cell-forward"
|
||||
\bind "C-Tab" "cell-split"
|
||||
\bind "~S-ISO_Left_Tab" "cell-backward"
|
||||
\bind "~S-BackTab" "cell-backward"
|
||||
|
||||
\bind "Home" "line-begin"
|
||||
\bind "End" "line-end"
|
||||
|
||||
\bind "Prior" "screen-up"
|
||||
\bind "Next" "screen-down"
|
||||
\bind "Return" "break-paragraph"
|
||||
\bind "Delete" "delete-forward"
|
||||
\bind "BackSpace" "delete-backward"
|
||||
|
||||
\bind "KP_Enter" "break-paragraph"
|
||||
\bind "KP_Right" "char-right"
|
||||
\bind "KP_Left" "char-left"
|
||||
\bind "KP_Up" "up"
|
||||
\bind "KP_Down" "down"
|
||||
\bind "KP_Home" "line-begin"
|
||||
\bind "KP_End" "line-end"
|
||||
\bind "KP_Prior" "screen-up"
|
||||
\bind "KP_Next" "screen-down"
|
54
src/LyX.cpp
54
src/LyX.cpp
@ -977,7 +977,7 @@ bool LyX::init()
|
||||
|
||||
// Set up bindings
|
||||
pimpl_->toplevel_keymap_.reset(new KeyMap);
|
||||
defaultKeyBindings(pimpl_->toplevel_keymap_.get());
|
||||
pimpl_->toplevel_keymap_->read("site");
|
||||
pimpl_->toplevel_keymap_->read(lyxrc.bind_file);
|
||||
// load user bind file user.bind
|
||||
pimpl_->toplevel_keymap_->read("user");
|
||||
@ -1029,58 +1029,6 @@ bool LyX::init()
|
||||
}
|
||||
|
||||
|
||||
void LyX::defaultKeyBindings(KeyMap * kbmap)
|
||||
{
|
||||
kbmap->bind("Right", FuncRequest(LFUN_CHAR_RIGHT));
|
||||
kbmap->bind("Left", FuncRequest(LFUN_CHAR_LEFT));
|
||||
kbmap->bind("Up", FuncRequest(LFUN_UP));
|
||||
kbmap->bind("Down", FuncRequest(LFUN_DOWN));
|
||||
|
||||
kbmap->bind("Tab", FuncRequest(LFUN_CELL_FORWARD));
|
||||
kbmap->bind("C-Tab", FuncRequest(LFUN_CELL_SPLIT));
|
||||
kbmap->bind("~S-ISO_Left_Tab", FuncRequest(LFUN_CELL_BACKWARD));
|
||||
kbmap->bind("~S-BackTab", FuncRequest(LFUN_CELL_BACKWARD));
|
||||
|
||||
kbmap->bind("Home", FuncRequest(LFUN_LINE_BEGIN));
|
||||
kbmap->bind("End", FuncRequest(LFUN_LINE_END));
|
||||
kbmap->bind("Prior", FuncRequest(LFUN_SCREEN_UP));
|
||||
kbmap->bind("Next", FuncRequest(LFUN_SCREEN_DOWN));
|
||||
|
||||
kbmap->bind("Return", FuncRequest(LFUN_BREAK_PARAGRAPH));
|
||||
//kbmap->bind("~C-~S-~M-nobreakspace", FuncRequest(LFUN_PROTECTEDSPACE));
|
||||
|
||||
kbmap->bind("Delete", FuncRequest(LFUN_CHAR_DELETE_FORWARD));
|
||||
kbmap->bind("BackSpace", FuncRequest(LFUN_CHAR_DELETE_BACKWARD));
|
||||
|
||||
// kbmap->bindings to enable the use of the numeric keypad
|
||||
// e.g. Num Lock set
|
||||
//kbmap->bind("KP_0", FuncRequest(LFUN_SELF_INSERT));
|
||||
//kbmap->bind("KP_Decimal", FuncRequest(LFUN_SELF_INSERT));
|
||||
kbmap->bind("KP_Enter", FuncRequest(LFUN_BREAK_PARAGRAPH));
|
||||
//kbmap->bind("KP_1", FuncRequest(LFUN_SELF_INSERT));
|
||||
//kbmap->bind("KP_2", FuncRequest(LFUN_SELF_INSERT));
|
||||
//kbmap->bind("KP_3", FuncRequest(LFUN_SELF_INSERT));
|
||||
//kbmap->bind("KP_4", FuncRequest(LFUN_SELF_INSERT));
|
||||
//kbmap->bind("KP_5", FuncRequest(LFUN_SELF_INSERT));
|
||||
//kbmap->bind("KP_6", FuncRequest(LFUN_SELF_INSERT));
|
||||
//kbmap->bind("KP_Add", FuncRequest(LFUN_SELF_INSERT));
|
||||
//kbmap->bind("KP_7", FuncRequest(LFUN_SELF_INSERT));
|
||||
//kbmap->bind("KP_8", FuncRequest(LFUN_SELF_INSERT));
|
||||
//kbmap->bind("KP_9", FuncRequest(LFUN_SELF_INSERT));
|
||||
//kbmap->bind("KP_Divide", FuncRequest(LFUN_SELF_INSERT));
|
||||
//kbmap->bind("KP_Multiply", FuncRequest(LFUN_SELF_INSERT));
|
||||
//kbmap->bind("KP_Subtract", FuncRequest(LFUN_SELF_INSERT));
|
||||
kbmap->bind("KP_Right", FuncRequest(LFUN_CHAR_RIGHT));
|
||||
kbmap->bind("KP_Left", FuncRequest(LFUN_CHAR_LEFT));
|
||||
kbmap->bind("KP_Up", FuncRequest(LFUN_UP));
|
||||
kbmap->bind("KP_Down", FuncRequest(LFUN_DOWN));
|
||||
kbmap->bind("KP_Home", FuncRequest(LFUN_LINE_BEGIN));
|
||||
kbmap->bind("KP_End", FuncRequest(LFUN_LINE_END));
|
||||
kbmap->bind("KP_Prior", FuncRequest(LFUN_SCREEN_UP));
|
||||
kbmap->bind("KP_Next", FuncRequest(LFUN_SCREEN_DOWN));
|
||||
}
|
||||
|
||||
|
||||
void LyX::emergencyCleanup() const
|
||||
{
|
||||
// what to do about tmpfiles is non-obvious. we would
|
||||
|
@ -144,8 +144,6 @@ private:
|
||||
|
||||
/// initial LyX set up
|
||||
bool init();
|
||||
/// set up the default key bindings
|
||||
void defaultKeyBindings(KeyMap * kbmap);
|
||||
/// set up the default dead key bindings if requested
|
||||
void deadKeyBindings(KeyMap * kbmap);
|
||||
/** Check for the existence of the user's support directory and,
|
||||
|
@ -1765,6 +1765,7 @@ void PrefShortcuts::apply(LyXRC & rc) const
|
||||
// immediately apply the keybindings. Why this is not done before?
|
||||
// The good thing is that the menus are updated automatically.
|
||||
theTopLevelKeymap().clear();
|
||||
theTopLevelKeymap().read("site");
|
||||
theTopLevelKeymap().read(rc.bind_file);
|
||||
theTopLevelKeymap().read("user");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user