]> git.lyx.org Git - features.git/commitdiff
Put bindings in defaultKeyBindings() to site.bind
authorBo Peng <bpeng@lyx.org>
Mon, 29 Oct 2007 19:45:43 +0000 (19:45 +0000)
committerBo Peng <bpeng@lyx.org>
Mon, 29 Oct 2007 19:45:43 +0000 (19:45 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21268 a592a061-630c-0410-9148-cb99ea01b6c8

development/scons/scons_manifest.py
lib/Makefile.am
lib/bind/site.bind [new file with mode: 0644]
src/LyX.cpp
src/LyX.h
src/frontends/qt4/GuiPrefs.cpp

index 5306c82cac81b0b69e62a11889a3d9fc28dbba03..076642af8bafe7ab8adbc907afb3055690c55757 100644 (file)
@@ -2669,6 +2669,7 @@ lib_bind_files = Split('''
     math.bind
     menus.bind
     sciword.bind
+    site.bind
     xemacs.bind
 ''')
 
index 13a9766a17aea63c70416e1ab79661f6973e2385..f447390b1432e1c54ad48292c73a4d9ae70a8a37 100644 (file)
@@ -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
 
diff --git a/lib/bind/site.bind b/lib/bind/site.bind
new file mode 100644 (file)
index 0000000..81d376b
--- /dev/null
@@ -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"
index 4bdf4434ca394a7c82fabc88ef0d694581f95247..829202e54c656e8d3a7d0e12125f0dd529d3026b 100644 (file)
@@ -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
index e7b18f40e393d652110ab93569ceb35e85ed037f..76f9d59fe3e1399e5c970c021004a92d733e05d9 100644 (file)
--- a/src/LyX.h
+++ b/src/LyX.h
@@ -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,
index 9fd303de60f5658432cb0099e940f82c8569c92c..f1eebfd5631488e7f90efe7596ab8fef48e57b98 100644 (file)
@@ -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");
 }