summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/FbTk/TextBox.cc41
1 files changed, 38 insertions, 3 deletions
diff --git a/src/FbTk/TextBox.cc b/src/FbTk/TextBox.cc
index fb1d484..02f32f0 100644
--- a/src/FbTk/TextBox.cc
+++ b/src/FbTk/TextBox.cc
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: TextBox.cc,v 1.14 2004/10/06 19:05:12 akir Exp $ 22// $Id: TextBox.cc,v 1.15 2004/10/08 11:52:33 akir Exp $
23 23
24#include "TextBox.hh" 24#include "TextBox.hh"
25#include "Font.hh" 25#include "Font.hh"
@@ -217,7 +217,7 @@ void TextBox::keyPressEvent(XKeyEvent &event) {
217 // a modifier key by itself doesn't do anything 217 // a modifier key by itself doesn't do anything
218 if (IsModifierKey(ks)) return; 218 if (IsModifierKey(ks)) return;
219 219
220 if (event.state) { // handle keybindings without state 220 if (event.state) { // handle keybindings with state
221 if (event.state == ControlMask) { 221 if (event.state == ControlMask) {
222 222
223 switch (ks) { 223 switch (ks) {
@@ -247,7 +247,7 @@ void TextBox::keyPressEvent(XKeyEvent &event) {
247 m_end_pos = 0; 247 m_end_pos = 0;
248 break; 248 break;
249 } 249 }
250 } else if (event.state == ShiftMask || event.state == 0x2000) { 250 } else if (event.state == ShiftMask || event.state == 0x80) { // shif and altgr
251 if (isprint(keychar[0])) { 251 if (isprint(keychar[0])) {
252 std::string val; 252 std::string val;
253 val += keychar[0]; 253 val += keychar[0];
@@ -277,6 +277,41 @@ void TextBox::keyPressEvent(XKeyEvent &event) {
277 deleteForward(); 277 deleteForward();
278 break; 278 break;
279 default: 279 default:
280 switch (ks) {
281 case XK_KP_Insert:
282 keychar[0] = '0';
283 break;
284 case XK_KP_End:
285 keychar[0] = '1';
286 break;
287 case XK_KP_Down:
288 keychar[0] = '2';
289 break;
290 case XK_KP_Page_Down:
291 keychar[0] = '3';
292 break;
293 case XK_KP_Left:
294 keychar[0] = '4';
295 break;
296 case XK_KP_Begin:
297 keychar[0] = '5';
298 break;
299 case XK_KP_Right:
300 keychar[0] = '6';
301 break;
302 case XK_KP_Home:
303 keychar[0] = '7';
304 break;
305 case XK_KP_Up:
306 keychar[0] = '8';
307 break;
308 case XK_KP_Page_Up:
309 keychar[0] = '9';
310 break;
311 case XK_KP_Delete:
312 keychar[0] = ',';
313 break;
314 };
280 if (isprint(keychar[0])) { 315 if (isprint(keychar[0])) {
281 std::string val; 316 std::string val;
282 val += keychar[0]; 317 val += keychar[0];