diff options
author | fluxgen <fluxgen> | 2003-12-31 00:36:16 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2003-12-31 00:36:16 (GMT) |
commit | 3ecca36129ae9ab0e7a0d80e074b483ef81fa505 (patch) | |
tree | 35ef1f53e41f00196caddd6ad5410d1e550584d8 | |
parent | 6bacfb6ed9f383ddfa3440102250dccbb591242c (diff) | |
download | fluxbox-3ecca36129ae9ab0e7a0d80e074b483ef81fa505.zip fluxbox-3ecca36129ae9ab0e7a0d80e074b483ef81fa505.tar.bz2 |
using num, scroll and capslock mask from KeyUtil. Using use_mod1 resource
-rw-r--r-- | src/Window.cc | 67 |
1 files changed, 37 insertions, 30 deletions
diff --git a/src/Window.cc b/src/Window.cc index 6cc3af9..9ba0f59 100644 --- a/src/Window.cc +++ b/src/Window.cc | |||
@@ -22,18 +22,10 @@ | |||
22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
23 | // DEALINGS IN THE SOFTWARE. | 23 | // DEALINGS IN THE SOFTWARE. |
24 | 24 | ||
25 | // $Id: Window.cc,v 1.258 2003/12/30 20:56:40 fluxgen Exp $ | 25 | // $Id: Window.cc,v 1.259 2003/12/31 00:36:16 fluxgen Exp $ |
26 | 26 | ||
27 | #include "Window.hh" | 27 | #include "Window.hh" |
28 | 28 | ||
29 | |||
30 | #include "FbTk/StringUtil.hh" | ||
31 | #include "FbTk/TextButton.hh" | ||
32 | #include "FbTk/Compose.hh" | ||
33 | #include "FbTk/EventManager.hh" | ||
34 | #include "FbTk/MultiButtonMenuItem.hh" | ||
35 | |||
36 | |||
37 | #include "WinClient.hh" | 29 | #include "WinClient.hh" |
38 | #include "I18n.hh" | 30 | #include "I18n.hh" |
39 | #include "fluxbox.hh" | 31 | #include "fluxbox.hh" |
@@ -49,6 +41,13 @@ | |||
49 | #include "WinButtonTheme.hh" | 41 | #include "WinButtonTheme.hh" |
50 | #include "SendToMenu.hh" | 42 | #include "SendToMenu.hh" |
51 | 43 | ||
44 | #include "FbTk/StringUtil.hh" | ||
45 | #include "FbTk/TextButton.hh" | ||
46 | #include "FbTk/Compose.hh" | ||
47 | #include "FbTk/EventManager.hh" | ||
48 | #include "FbTk/MultiButtonMenuItem.hh" | ||
49 | #include "FbTk/KeyUtil.hh" | ||
50 | |||
52 | #ifdef HAVE_CONFIG_H | 51 | #ifdef HAVE_CONFIG_H |
53 | #include "config.h" | 52 | #include "config.h" |
54 | #endif // HAVE_CONFIG_H | 53 | #endif // HAVE_CONFIG_H |
@@ -77,39 +76,46 @@ namespace { | |||
77 | 76 | ||
78 | void grabButton(Display *display, unsigned int button, | 77 | void grabButton(Display *display, unsigned int button, |
79 | Window window, Cursor cursor) { | 78 | Window window, Cursor cursor) { |
79 | |||
80 | const int numlock = FbTk::KeyUtil::instance().numlock(); | ||
81 | const int capslock = FbTk::KeyUtil::instance().capslock(); | ||
82 | const int scrolllock = FbTk::KeyUtil::instance().scrolllock(); | ||
83 | |||
84 | // Grab with Mod1 and with all lock modifiers | ||
85 | // (num, scroll and caps) | ||
80 | 86 | ||
81 | //numlock | 87 | //numlock |
82 | XGrabButton(display, button, Mod1Mask|Mod2Mask, window, True, | 88 | XGrabButton(display, button, Mod1Mask|numlock, window, True, |
83 | ButtonReleaseMask | ButtonMotionMask, GrabModeAsync, | 89 | ButtonReleaseMask | ButtonMotionMask, GrabModeAsync, |
84 | GrabModeAsync, None, cursor); | 90 | GrabModeAsync, None, cursor); |
85 | //scrolllock | 91 | //scrolllock |
86 | XGrabButton(display, button, Mod1Mask|Mod5Mask, window, True, | 92 | XGrabButton(display, button, Mod1Mask|scrolllock, window, True, |
87 | ButtonReleaseMask | ButtonMotionMask, GrabModeAsync, | 93 | ButtonReleaseMask | ButtonMotionMask, GrabModeAsync, |
88 | GrabModeAsync, None, cursor); | 94 | GrabModeAsync, None, cursor); |
89 | 95 | ||
90 | //capslock | 96 | //capslock |
91 | XGrabButton(display, button, Mod1Mask|LockMask, window, True, | 97 | XGrabButton(display, button, Mod1Mask|capslock, window, True, |
92 | ButtonReleaseMask | ButtonMotionMask, GrabModeAsync, | 98 | ButtonReleaseMask | ButtonMotionMask, GrabModeAsync, |
93 | GrabModeAsync, None, cursor); | 99 | GrabModeAsync, None, cursor); |
94 | 100 | ||
95 | //capslock+numlock | 101 | //capslock+numlock |
96 | XGrabButton(display, Button1, Mod1Mask|LockMask|Mod2Mask, window, True, | 102 | XGrabButton(display, Button1, Mod1Mask|capslock|numlock, window, True, |
97 | ButtonReleaseMask | ButtonMotionMask, GrabModeAsync, | 103 | ButtonReleaseMask | ButtonMotionMask, GrabModeAsync, |
98 | GrabModeAsync, None, cursor); | 104 | GrabModeAsync, None, cursor); |
99 | 105 | ||
100 | //capslock+scrolllock | 106 | //capslock+scrolllock |
101 | XGrabButton(display, button, Mod1Mask|LockMask|Mod5Mask, window, True, | 107 | XGrabButton(display, button, Mod1Mask|capslock|scrolllock, window, True, |
102 | ButtonReleaseMask | ButtonMotionMask, GrabModeAsync, | 108 | ButtonReleaseMask | ButtonMotionMask, GrabModeAsync, |
103 | GrabModeAsync, None, cursor); | 109 | GrabModeAsync, None, cursor); |
104 | 110 | ||
105 | //capslock+numlock+scrolllock | 111 | //capslock+numlock+scrolllock |
106 | XGrabButton(display, button, Mod1Mask|LockMask|Mod2Mask|Mod5Mask, window, | 112 | XGrabButton(display, button, Mod1Mask|capslock|numlock|scrolllock, window, |
107 | True, | 113 | True, |
108 | ButtonReleaseMask | ButtonMotionMask, GrabModeAsync, | 114 | ButtonReleaseMask | ButtonMotionMask, GrabModeAsync, |
109 | GrabModeAsync, None, cursor); | 115 | GrabModeAsync, None, cursor); |
110 | 116 | ||
111 | //numlock+scrollLock | 117 | //numlock+scrollLock |
112 | XGrabButton(display, button, Mod1Mask|Mod2Mask|Mod5Mask, window, True, | 118 | XGrabButton(display, button, Mod1Mask|numlock|scrolllock, window, True, |
113 | ButtonReleaseMask | ButtonMotionMask, GrabModeAsync, | 119 | ButtonReleaseMask | ButtonMotionMask, GrabModeAsync, |
114 | GrabModeAsync, None, cursor); | 120 | GrabModeAsync, None, cursor); |
115 | 121 | ||
@@ -940,23 +946,24 @@ void FluxboxWindow::grabButtons() { | |||
940 | GrabModeSync, GrabModeSync, None, None); | 946 | GrabModeSync, GrabModeSync, None, None); |
941 | XUngrabButton(display, Button1, Mod1Mask|Mod2Mask|Mod3Mask, frame().window().window()); | 947 | XUngrabButton(display, Button1, Mod1Mask|Mod2Mask|Mod3Mask, frame().window().window()); |
942 | 948 | ||
949 | if (Fluxbox::instance()->useMod1()) { | ||
950 | XGrabButton(display, Button1, Mod1Mask, frame().window().window(), True, | ||
951 | ButtonReleaseMask | ButtonMotionMask, GrabModeAsync, | ||
952 | GrabModeAsync, None, frame().theme().moveCursor()); | ||
943 | 953 | ||
944 | XGrabButton(display, Button1, Mod1Mask, frame().window().window(), True, | 954 | //----grab with "all" modifiers |
945 | ButtonReleaseMask | ButtonMotionMask, GrabModeAsync, | 955 | grabButton(display, Button1, frame().window().window(), frame().theme().moveCursor()); |
946 | GrabModeAsync, None, frame().theme().moveCursor()); | 956 | |
947 | 957 | XGrabButton(display, Button2, Mod1Mask, frame().window().window(), True, | |
948 | //----grab with "all" modifiers | 958 | ButtonReleaseMask, GrabModeAsync, GrabModeAsync, None, None); |
949 | grabButton(display, Button1, frame().window().window(), frame().theme().moveCursor()); | ||
950 | |||
951 | XGrabButton(display, Button2, Mod1Mask, frame().window().window(), True, | ||
952 | ButtonReleaseMask, GrabModeAsync, GrabModeAsync, None, None); | ||
953 | 959 | ||
954 | XGrabButton(display, Button3, Mod1Mask, frame().window().window(), True, | 960 | XGrabButton(display, Button3, Mod1Mask, frame().window().window(), True, |
955 | ButtonReleaseMask | ButtonMotionMask, GrabModeAsync, | 961 | ButtonReleaseMask | ButtonMotionMask, GrabModeAsync, |
956 | GrabModeAsync, None, None); | 962 | GrabModeAsync, None, None); |
957 | 963 | ||
958 | //---grab with "all" modifiers | 964 | //---grab with "all" modifiers |
959 | grabButton(display, Button3, frame().window().window(), None); | 965 | grabButton(display, Button3, frame().window().window(), None); |
966 | } | ||
960 | } | 967 | } |
961 | 968 | ||
962 | 969 | ||