comparison libgui/src/octave-qt-link.cc @ 16658:591cb51c18a3

always handle CTRL-C as interrupt on windows systems * QTerminal.h (QTerminal::QTerminal): Don't set shortcuts for copy and paste. * octave-qt-link.cc (octave_qt_link::do_pre_input_event, octave_qt_link::do_post_input_event): Don't enable/disable processed input on Windows systems.
author John W. Eaton <jwe@octave.org>
date Tue, 14 May 2013 02:49:24 -0400
parents b04413e5a811
children c50ee84842a9
comparison
equal deleted inserted replaced
16657:c1d5bf2eb3b6 16658:591cb51c18a3
36 #include "load-path.h" 36 #include "load-path.h"
37 #include "oct-env.h" 37 #include "oct-env.h"
38 #include "utils.h" 38 #include "utils.h"
39 39
40 #include "octave-qt-link.h" 40 #include "octave-qt-link.h"
41
42 #if defined (Q_OS_WIN32)
43 #define WIN32_LEAN_AND_MEAN
44 #define _WIN32_WINNT 0x0500
45 #include <windows.h>
46 #endif
47 41
48 octave_qt_link::octave_qt_link (octave_main_thread *mt) 42 octave_qt_link::octave_qt_link (octave_main_thread *mt)
49 : octave_link (), main_thread (mt) 43 : octave_link (), main_thread (mt)
50 { } 44 { }
51 45
375 } 369 }
376 370
377 void 371 void
378 octave_qt_link::do_pre_input_event (void) 372 octave_qt_link::do_pre_input_event (void)
379 { 373 {
380 #if defined (Q_OS_WIN32)
381 // Disable Ctrl-C processing on stdin.
382 HANDLE hStdIn = GetStdHandle (STD_INPUT_HANDLE);
383 DWORD mode;
384 GetConsoleMode (hStdIn, &mode);
385 SetConsoleMode (hStdIn, mode & ~ ENABLE_PROCESSED_INPUT);
386 #endif
387 } 374 }
388 375
389 void 376 void
390 octave_qt_link::do_post_input_event (void) 377 octave_qt_link::do_post_input_event (void)
391 { 378 {
392 #if defined (Q_OS_WIN32)
393 // Enable Ctrl-C processing on stdin.
394 HANDLE hStdIn = GetStdHandle (STD_INPUT_HANDLE);
395 DWORD mode;
396 GetConsoleMode (hStdIn, &mode);
397 SetConsoleMode (hStdIn, mode | ENABLE_PROCESSED_INPUT);
398 #endif
399 } 379 }
400 380
401 void 381 void
402 octave_qt_link::do_enter_debugger_event (const std::string& file, int line) 382 octave_qt_link::do_enter_debugger_event (const std::string& file, int line)
403 { 383 {