|
From: Tatsuro M. <tma...@ya...> - 2014-06-22 08:36:30
|
Hello http://gnuplot.10905.n7.nabble.com/Spacebar-does-not-raise-command-window-with-wxt-terminal-td18540.html For qt terminal, this feature seems not to be implemented. (Right?) Although I do not have enough knowledge, I tried to implement it. I looked into qt_term.cpp and QtGnuplotScene.cpp. In QtGnuplotScene.cpp, qt terminal seems to return key information in void QtGnuplotScene::keyPressEvent(QKeyEvent* event) <snip> live = m_eventHandler->postTermEvent(GE_keypress, int(m_lastMousePos.x()), int(m_lastMousePos.y()), key, 0, m_widget); While in qt_term.cpp, /*------------------------------------------------------- * Communication terminal -> gnuplot *-------------------------------------------------------*/ bool qt_processTermEvent(gp_event_t* event) <snip> if ((event->type == GE_keypress) && (paused_for_mouse & PAUSE_KEYSTROKE) && (event->par1 > '\0')) However, 'struct gp_event_t' has no member named 'key' How I do get key information from qt terminal to gnuplot? Thank you in advance. Tatsuro |
|
From: sfeam <sf...@us...> - 2014-06-22 16:40:11
|
On Sunday, 22 June 2014 05:36:20 PM Tatsuro MATSUOKA wrote: > Hello > > http://gnuplot.10905.n7.nabble.com/Spacebar-does-not-raise-command-window-with-wxt-terminal-td18540.html > > > For qt terminal, this feature seems not to be implemented. (Right?) > Although I do not have enough knowledge, I tried to implement it. > I looked into qt_term.cpp and QtGnuplotScene.cpp. > > In QtGnuplotScene.cpp, qt terminal seems to return key information in > > void QtGnuplotScene::keyPressEvent(QKeyEvent* event) > <snip> > live = m_eventHandler->postTermEvent(GE_keypress, > int(m_lastMousePos.x()), int(m_lastMousePos.y()), key, 0, m_widget); > > While in qt_term.cpp, > > /*------------------------------------------------------- > * Communication terminal -> gnuplot > *-------------------------------------------------------*/ > > bool qt_processTermEvent(gp_event_t* event) > <snip> > if ((event->type == GE_keypress) && (paused_for_mouse & PAUSE_KEYSTROKE) && (event->par1 > '\0')) > > > However, > 'struct gp_event_t' has no member named 'key' > > > How I do get key information from qt terminal to gnuplot? The simplest way is gnuplot> bind "<key>" "command to execute" No code change to the qt terminal is needed. However there is not currently a "command to execute" that raises the console window. The "raise" command acts on the plot window, not the console window. Why does the "raise console" function use different code for each terminal type? The console is the same no matter what terminal is in use. Am I missing something? My current thinking is that the special code to raise the console should be removed from all terminals. Instead we could add a routine in mouse.c that responds to the keystroke after it is passed to the gnuplot core. This would be shared by all terminals. Ethan |
|
From: Tatsuro M. <tma...@ya...> - 2014-06-22 19:13:58
|
----- Original Message ----- > From: sfeam > To: gnuplot-beta Tatsuro MATSUOKA > Cc: > Date: 2014/6/23, Mon 01:37 > Subject: Re: How to get key information from qt terminal to gnuplot > > On Sunday, 22 June 2014 05:36:20 PM Tatsuro MATSUOKA wrote: >> Hello >> >> > http://gnuplot.10905.n7.nabble.com/Spacebar-does-not-raise-command-window-with-wxt-terminal-td18540.html >> >> >> For qt terminal, this feature seems not to be implemented. (Right?) >> Although I do not have enough knowledge, I tried to implement it. >> I looked into qt_term.cpp and QtGnuplotScene.cpp. >> >> In QtGnuplotScene.cpp, qt terminal seems to return key information in >> >> void QtGnuplotScene::keyPressEvent(QKeyEvent* event) >> <snip> >> live = m_eventHandler->postTermEvent(GE_keypress, >> int(m_lastMousePos.x()), int(m_lastMousePos.y()), key, 0, m_widget); >> >> While in qt_term.cpp, >> >> /*------------------------------------------------------- >> * Communication terminal -> gnuplot >> *-------------------------------------------------------*/ >> >> bool qt_processTermEvent(gp_event_t* event) >> <snip> >> if ((event->type == GE_keypress) && (paused_for_mouse & > PAUSE_KEYSTROKE) && (event->par1 > '\0')) >> >> >> However, >> 'struct gp_event_t' has no member named 'key' >> >> >> How I do get key information from qt terminal to gnuplot? > > The simplest way is > gnuplot> bind "<key>" "command to execute" > > No code change to the qt terminal is needed. However there is not > currently a "command to execute" that raises the console window. > The "raise" command acts on the plot window, not the console window. > > Why does the "raise console" function use different code for each > terminal type? The console is the same no matter what terminal is > in use. Am I missing something? > > My current thinking is that the special code to raise the console > should be removed from all terminals. > Instead we could add a routine in mouse.c that responds to the > keystroke after it is passed to the gnuplot core. This would be > shared by all terminals. > > Ethan OK. I agree with you. Thanks for the pointer. Thanks! |
|
From: Tatsuro M. <tma...@ya...> - 2014-06-22 19:59:17
|
----- Original Message ----- > From: Tatsuro MATSUOKA > To: Merritt Ethan ; gnuplot-beta > Cc: > Date: 2014/6/23, Mon 04:13 > Subject: Re: How to get key information from qt terminal to gnuplot > ----- Original Message ----- >> From: sfeam >> To: gnuplot-beta Tatsuro MATSUOKA >> Cc: >> Date: 2014/6/23, Mon 01:37 >> Subject: Re: How to get key information from qt terminal to gnuplot >> >> On Sunday, 22 June 2014 05:36:20 PM Tatsuro MATSUOKA wrote: >>> Hello >>> >>> >> > http://gnuplot.10905.n7.nabble.com/Spacebar-does-not-raise-command-window-with-wxt-terminal-td18540.html >>> >>> >>> For qt terminal, this feature seems not to be implemented. (Right?) >>> Although I do not have enough knowledge, I tried to implement it. >>> I looked into qt_term.cpp and QtGnuplotScene.cpp. >>> >>> In QtGnuplotScene.cpp, qt terminal seems to return key information in >>> >>> void QtGnuplotScene::keyPressEvent(QKeyEvent* event) >>> <snip> >>> live = m_eventHandler->postTermEvent(GE_keypress, >>> int(m_lastMousePos.x()), int(m_lastMousePos.y()), key, 0, m_widget); >>> >>> While in qt_term.cpp, >>> >>> /*------------------------------------------------------- >>> * Communication terminal -> gnuplot >>> *-------------------------------------------------------*/ >>> >>> bool qt_processTermEvent(gp_event_t* event) >>> <snip> >>> if ((event->type == GE_keypress) && (paused_for_mouse & > >> PAUSE_KEYSTROKE) && (event->par1 > '\0')) >>> >>> >>> However, >>> 'struct gp_event_t' has no member named 'key' >>> >>> >>> How I do get key information from qt terminal to gnuplot? >> >> The simplest way is >> gnuplot> bind "<key>" "command to execute" >> >> No code change to the qt terminal is needed. However there is not >> currently a "command to execute" that raises the console window. >> The "raise" command acts on the plot window, not the console > window. >> >> Why does the "raise console" function use different code for each >> terminal type? The console is the same no matter what terminal is >> in use. Am I missing something? >> >> My current thinking is that the special code to raise the console >> should be removed from all terminals. >> Instead we could add a routine in mouse.c that responds to the >> keystroke after it is passed to the gnuplot core. This would be >> shared by all terminals. >> >> Ethan > OK. I agree with you. > Thanks for the pointer. Although I agree with Ethan, it is important to know the code to get information what key pressed from gnuplot_qt to gnuplot. I will appreciate that some will show the way. Tatsuro |
|
From: sfeam <sf...@us...> - 2014-06-22 20:16:09
|
On Monday, 23 June 2014 04:59:06 AM Tatsuro MATSUOKA wrote: > ----- Original Message ----- > > > From: Tatsuro MATSUOKA > > To: Merritt Ethan ; gnuplot-beta > > Cc: > > Date: 2014/6/23, Mon 04:13 > > Subject: Re: How to get key information from qt terminal to gnuplot > > ----- Original Message ----- > >> From: sfeam > >> To: gnuplot-beta Tatsuro MATSUOKA > >> Cc: > >> Date: 2014/6/23, Mon 01:37 > >> Subject: Re: How to get key information from qt terminal to gnuplot > >> > >> On Sunday, 22 June 2014 05:36:20 PM Tatsuro MATSUOKA wrote: > >>> Hello > >>> > >>> > >> > > http://gnuplot.10905.n7.nabble.com/Spacebar-does-not-raise-command-window-with-wxt-terminal-td18540.html > >>> > >>> > >>> For qt terminal, this feature seems not to be implemented. (Right?) > >>> Although I do not have enough knowledge, I tried to implement it. > >>> I looked into qt_term.cpp and QtGnuplotScene.cpp. > >>> > >>> In QtGnuplotScene.cpp, qt terminal seems to return key information in > >>> > >>> void QtGnuplotScene::keyPressEvent(QKeyEvent* event) > >>> <snip> > >>> live = m_eventHandler->postTermEvent(GE_keypress, > >>> int(m_lastMousePos.x()), int(m_lastMousePos.y()), key, 0, m_widget); > >>> > >>> While in qt_term.cpp, > >>> > >>> /*------------------------------------------------------- > >>> * Communication terminal -> gnuplot > >>> *-------------------------------------------------------*/ > >>> > >>> bool qt_processTermEvent(gp_event_t* event) > >>> <snip> > >>> if ((event->type == GE_keypress) && (paused_for_mouse & > > > >> PAUSE_KEYSTROKE) && (event->par1 > '\0')) > >>> > >>> > >>> However, > >>> 'struct gp_event_t' has no member named 'key' > >>> > >>> > >>> How I do get key information from qt terminal to gnuplot? > >> > >> The simplest way is > >> gnuplot> bind "<key>" "command to execute" > >> > >> No code change to the qt terminal is needed. However there is not > >> currently a "command to execute" that raises the console window. > >> The "raise" command acts on the plot window, not the console > > window. > >> > >> Why does the "raise console" function use different code for each > >> terminal type? The console is the same no matter what terminal is > >> in use. Am I missing something? > >> > >> My current thinking is that the special code to raise the console > >> should be removed from all terminals. > >> Instead we could add a routine in mouse.c that responds to the > >> keystroke after it is passed to the gnuplot core. This would be > >> shared by all terminals. > >> > >> Ethan > > OK. I agree with you. > > Thanks for the pointer. > > > Although I agree with Ethan, it is important to know the code to get information what key pressed > from gnuplot_qt to gnuplot. I will appreciate that some will show the way. %%%%%%%%%%%%%%%%%%%%%%%%%%%%% QtGnuplotScene.cpp (line 965) live = m_eventHandler->postTermEvent(GE_keypress, int(m_lastMousePos.x()), int(m_lastMousePos.y()), key, 0, m_widget); %%%%%%%%%%%%%%%%%%%%%%%%%%%%% QtGnuplotEvent.cpp: bool QtGnuplotEventHandler::postTermEvent(int type, int mx, int my, int par1, int par2, QtGnuplotWidget* widget) { if ((m_socket == 0) || (m_socket->state() != QLocalSocket::ConnectedState) || (widget && !widget->isActive())) return false; gp_event_t event; event.type = type; event.mx = mx; event.my = my; event.par1 = par1; event.par2 = par2; event.winid = 0; // We don't forward any window id to gnuplot m_socket->write((char*) &event, sizeof(gp_event_t)); return true; } %%%%%%%%%%%%%%%%%%%%%%%%%%%% qt_term.cpp: /*------------------------------------------------------- * Communication terminal -> gnuplot *-------------------------------------------------------*/ bool qt_processTermEvent(gp_event_t* event) { [...] do_event(event); %%%%%%%%%%%%%%%%%%%%%%%%%%%%% mouse.c: do_event(struct gp_event_t *ge) case GE_keypress: event_keypress(ge, TRUE); break; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% mouse.c: event_keypress() Ethan |
|
From: Petr M. <mi...@ph...> - 2014-06-22 22:09:02
|
> Why does the "raise console" function use different code for each > terminal type? The console is the same no matter what terminal is > in use. Am I missing something? > > My current thinking is that the special code to raise the console > should be removed from all terminals. > Instead we could add a routine in mouse.c that responds to the > keystroke after it is passed to the gnuplot core. This would be > shared by all terminals. At the time I've implemented it, I've found it is not possible. The gnuplot executable is a console application, while the graphic window is X11, OS/2 Presentation Manager, Windows etc. application (communicating via different ways) and thus compiled and linked differently. So gnuplot binary is not linked to the respective X11/os2/... libraries needed to call the window manager in order to manipulate another window. --- Petr |
|
From: sfeam <sf...@us...> - 2014-06-23 05:56:10
|
On Monday, 23 June 2014 12:08:51 AM Petr Mikulik wrote: > > Why does the "raise console" function use different code for each > > terminal type? The console is the same no matter what terminal is > > in use. Am I missing something? > > > > My current thinking is that the special code to raise the console > > should be removed from all terminals. > > Instead we could add a routine in mouse.c that responds to the > > keystroke after it is passed to the gnuplot core. This would be > > shared by all terminals. > > At the time I've implemented it, I've found it is not possible. > > The gnuplot executable is a console application, while the graphic window is > X11, OS/2 Presentation Manager, Windows etc. application (communicating via > different ways) and thus compiled and linked differently. So gnuplot binary is > not linked to the respective X11/os2/... libraries needed to call the window > manager in order to manipulate another window. That may have been true at the time, but currently the main program is linked against both gdk and X11 when it is built on linux. So the same call that wxt uses could be placed in the main code. I do not know about MSWin. Ethan |
|
From: Tatsuro M. <tma...@ya...> - 2014-06-23 09:23:45
|
----- Original Message -----
> From: sfeam
> To: gnuplot-beta
> Cc: Petr Mikulik
> Date: 2014/6/23, Mon 14:52
> Subject: Re: How to get key information from qt terminal to gnuplot
>
> That may have been true at the time, but currently the main program is linked
> against both gdk and X11 when it is built on linux. So the same call
> that wxt uses could be placed in the main code.
> I do not know about MSWin.
For windows terminal (but no wxt on windows),
SPACE_RAISES_CONSOLE feature is implemented in wgraph.c
Key code is obtained in windows way.
*************************************************************
case WM_CHAR:
/* All 'normal' keys (letters, digits and the likes) end up
* here... */
#ifndef DISABLE_SPACE_RAISES_CONSOLE
if (wParam == VK_SPACE) {
WinRaiseConsole();
return 0L;
}
*************************************************************
WinRaiseConsole() is described in winmain.c
*************************************************************
void
WinRaiseConsole(void)
{
HWND console = NULL;
#ifndef WGP_CONSOLE
console = textwin.hWndParent;
#else
console = GetConsoleWindow();
#endif
if (console != NULL) {
ShowWindow(console, SW_SHOWNORMAL);
BringWindowToTop(console);
}
}
*************************************************************
In wxt terminal on windows (wxt_gui.cpp), key code scan seems to be wrapped by
event.GetKeyCode()
Using the keycode
*************************************************************
switch (keycode) {
#ifndef DISABLE_SPACE_RAISES_CONSOLE
case WXK_SPACE :
if ((wxt_ctrl==yes && event.ControlDown())
|| wxt_ctrl!=yes) {
RaiseConsoleWindow();
return;
} else {
gp_keycode = ' ';
break;
}
#endif /* DISABLE_SPACE_RAISES_CONSOLE */
*************************************************************
Function RaiseConsoleWindow() is described in winmain.c
wxtPanel::RaiseConsoleWindow() is described dependent on platform,
The wxt terminal for windows uses WinRaiseConsole() in winmain.c.
For windows terminal it should be required to write wrapper function to keycode to implement the Ethan's idea.
Tatsuro
|
|
From: Tatsuro M. <tma...@ya...> - 2014-06-23 19:33:44
|
Correction
----- Original Message -----
> From: Tatsuro MATSUOKA
> To: Merritt Ethan ; gnuplot-bet
> Cc: Petr Mikulik
> Date: 2014/6/23, Mon 18:23
> Subject: Re: How to get key information from qt terminal to gnuplot
>
> ----- Original Message -----
>
>> From: sfeam
>> To: gnuplot-beta
>> Cc: Petr Mikulik
>> Date: 2014/6/23, Mon 14:52
>> Subject: Re: How to get key information from qt terminal to gnuplot
>>
>
>> That may have been true at the time, but currently the main program is
> linked
>> against both gdk and X11 when it is built on linux. So the same call
>> that wxt uses could be placed in the main code.
>
>> I do not know about MSWin.
>
> For windows terminal (but no wxt on windows),
> SPACE_RAISES_CONSOLE feature is implemented in wgraph.c
>
> Key code is obtained in windows way.
>
> *************************************************************
>
> case WM_CHAR:
> /* All 'normal' keys (letters, digits and the likes) end up
> * here... */
> #ifndef DISABLE_SPACE_RAISES_CONSOLE
> if (wParam == VK_SPACE) {
> WinRaiseConsole();
> return 0L;
> }
> *************************************************************
>
> WinRaiseConsole() is described in winmain.c
>
>
>
>
>
> *************************************************************
>
> void
> WinRaiseConsole(void)
> {
> HWND console = NULL;
> #ifndef WGP_CONSOLE
> console = textwin.hWndParent;
> #else
> console = GetConsoleWindow();
> #endif
> if (console != NULL) {
> ShowWindow(console, SW_SHOWNORMAL);
> BringWindowToTop(console);
> }
> }
> *************************************************************
>
>
>
>
> In wxt terminal on windows (wxt_gui.cpp), key code scan seems to be wrapped by
> event.GetKeyCode()
>
> Using the keycode
> *************************************************************
> switch (keycode) {
>
>
> #ifndef DISABLE_SPACE_RAISES_CONSOLE
> case WXK_SPACE :
> if ((wxt_ctrl==yes && event.ControlDown())
> || wxt_ctrl!=yes) {
> RaiseConsoleWindow();
> return;
> } else {
> gp_keycode = ' ';
> break;
> }
> #endif /* DISABLE_SPACE_RAISES_CONSOLE */
> *************************************************************
> Function RaiseConsoleWindow() is described in winmain.c
should be
Function RaiseConsoleWindow() is described in wxtPanel::RaiseConsoleWindow()
> wxtPanel::RaiseConsoleWindow() is described dependent on platform,
>
>
> The wxt terminal for windows uses WinRaiseConsole() in winmain.c.
>
> For windows terminal it should be required to write wrapper function to keycode
> to implement the Ethan's idea.
>
> Tatsuro
>
>
|
|
From: Tatsuro M. <tma...@ya...> - 2014-06-23 19:49:47
|
----- Original Message ----- > From: sfeam > To: gnuplot-beta > Cc: Petr Mikulik > Date: 2014/6/23, Mon 14:52 > Subject: Re: How to get key information from qt terminal to gnuplot > Although Ethan's idea is attractive, I will try console raise feature for qt terminal by Petr's way at this moment. To implement Ethan's idea, we have to have wrapper function to get keycode. This is because each terminal implements the way to get keycode diffident way and keycode map for each the terminal is different (especially of windows). I will wait that someone who has good knowledge inter platform try to implement. Regards Tatsuro |
|
From: Ethan A M. <sf...@us...> - 2014-06-23 19:56:25
|
On Tuesday, 24 June, 2014 04:49:36 Tatsuro MATSUOKA wrote: > > ----- Original Message ----- > > From: sfeam > > To: gnuplot-beta > > Cc: Petr Mikulik > > Date: 2014/6/23, Mon 14:52 > > Subject: Re: How to get key information from qt terminal to gnuplot > > > Although Ethan's idea is attractive, I will try console raise feature for qt terminal by Petr's way at this moment. > To implement Ethan's idea, we have to have wrapper function to get keycode. > This is because each terminal implements the way to get keycode diffident way and keycode map for each the terminal is different (especially of windows). > > I will wait that someone who has good knowledge inter platform try to implement. Isn't it true that all terminals already do the necessary key-code processing so that they can send key events to the core code in mouse.c? For example, does "mouselabels.dem" work on MSWin? That demo reads keystrokes in the plot window, turns them into labels in the core code, and then replots with the new label. If the demo works, it shows that keycodes including the space-key are correctly transmitted to the core code. Ethan |
|
From: Tait <gnu...@t4...> - 2014-06-23 20:32:12
|
Ethan A Merritt <sf...@us...> said (on 2014/06/23): > Isn't it true that all terminals already do the necessary key-code > processing so that they can send key events to the core code in mouse.c? > > For example, does "mouselabels.dem" work on MSWin? That demo reads > keystrokes in the plot window, turns them into labels in the core code, and then > replots with the new label. If the demo works, it shows that keycodes including > the space-key are correctly transmitted to the core code. > > Ethan The mouselabels demo does work* on Windows in wxt and windows terms, although one cannot create a label containing a space (because the space brings up the console) or q (it is ignored). * for some value of "works"... The Windows terminal tends to eat keystrokes unless they're typed much more slowly than a normal typing pace. The wxt terminal places the red text on top of the black, making it impossible to read either, and sometimes (I haven't figured out how to replicate it on-demand) backspace doesn't work. Both seem to add an extra "\033" label after hitting ESC to end label input. None of the Windows builds have a qt terminal to try. |
|
From: Tatsuro M. <tma...@ya...> - 2014-06-23 21:18:34
|
----- Original Message ----- > From: Tait > To: gnuplot-bet > Cc: > Date: 2014/6/24, Tue 05:32 > Subject: Re: How to get key information from qt terminal to gnuplot > > Ethan A Merritt said (on 2014/06/23): >> Isn't it true that all terminals already do the necessary key-code >> processing so that they can send key events to the core code in mouse.c? >> >> For example, does "mouselabels.dem" work on MSWin? That demo > reads >> keystrokes in the plot window, turns them into labels in the core code, and > then >> replots with the new label. If the demo works, it shows that keycodes > including >> the space-key are correctly transmitted to the core code. >> >> Ethan > > The mouselabels demo does work* on Windows in wxt and windows terms, > although one cannot create a label containing a space (because the > space brings up the console) or q (it is ignored). > > * for some value of "works"... The Windows terminal tends to eat > keystrokes unless they're typed much more slowly than a normal typing > pace. The wxt terminal places the red text on top of the black, making > it impossible to read either, and sometimes (I haven't figured out how > to replicate it on-demand) backspace doesn't work. Both seem to add an > extra "\033" label after hitting ESC to end label input. None of > the > Windows builds have a qt terminal to try. Tait is right. For qt on windows, mouselabels demo does not work. As the first work, I will try to mouselabels demo to wrok on qt for windows. Tatsuro |
|
From: Tatsuro M. <tma...@ya...> - 2014-06-23 23:43:58
|
----- Original Message ----- > From: Tatsuro MATSUOKA > To: Tait gnuplot-beta> Cc: > Date: 2014/6/24, Tue 06:18 > Subject: Re: How to get key information from qt terminal to gnuplot > ----- Original Message ----- >> From: Tait >> To: gnuplot-bet >> Cc: >> Date: 2014/6/24, Tue 05:32 >> Subject: Re: How to get key information from qt terminal to gnuplot >> >> Ethan A Merritt said (on 2014/06/23): >>> Isn't it true that all terminals already do the necessary key-code >>> processing so that they can send key events to the core code in > mouse.c? >>> >>> For example, does "mouselabels.dem" work on MSWin? That > demo >> reads >>> keystrokes in the plot window, turns them into labels in the core > code, and >> then >>> replots with the new label. If the demo works, it shows that > keycodes >> including >>> the space-key are correctly transmitted to the core code. >>> >>> Ethan >> >> The mouselabels demo does work* on Windows in wxt and windows terms, >> although one cannot create a label containing a space (because the >> space brings up the console) or q (it is ignored). >> >> * for some value of "works"... The Windows terminal tends to eat >> keystrokes unless they're typed much more slowly than a normal typing >> pace. The wxt terminal places the red text on top of the black, making >> it impossible to read either, and sometimes (I haven't figured out how >> to replicate it on-demand) backspace doesn't work. Both seem to add an >> extra "\033" label after hitting ESC to end label input. None > of >> the >> Windows builds have a qt terminal to try. > > > Tait is right. > For qt on windows, mouselabels demo does not work. > > As the first work, I will try to mouselabels demo to wrok on qt for windows. > > Tatsuro I misled the mouselabels demo, I have execute it on wxt and windows terminmal on windows. That worked but echo back 'paused' to the command screen at each key stoke. This is not a bug but it is annoying. I have execute mouselabels demo on qt terminal on Ubuntu 12.04 LTS. It partially work. Key input reflected in the plot window. However, <del>, <bs> and <esc> work but <tab> does not work. The qt terminal seems to have bug for key input handling but behave differently on windows and Linux. Regards Tatsuro |
|
From: Tatsuro M. <tma...@ya...> - 2014-06-24 03:15:17
|
----- Original Message ----- > From: Tatsuro MATSUOKA > To: tmacchant3Tait; gnuplot-beta > Cc: > Date: 2014/6/24, Tue 08:43 > Subject: Re: How to get key information from qt terminal to gnuplot > > ----- Original Message ----- > >> From: Tatsuro MATSUOKA >> To: Tait gnuplot-beta> Cc: >> Date: 2014/6/24, Tue 06:18 >> Subject: Re: How to get key information from qt terminal to gnuplot >> ----- Original Message ----- >>> From: Tait >>> To: gnuplot-bet >>> Cc: >>> Date: 2014/6/24, Tue 05:32 >>> Subject: Re: How to get key information from qt terminal to gnuplot >>> >>> Ethan A Merritt said (on 2014/06/23): >>>> Isn't it true that all terminals already do the necessary > key-code >>>> processing so that they can send key events to the core code in >> mouse.c? >>>> >>>> For example, does "mouselabels.dem" work on MSWin? > That >> demo >>> reads >>>> keystrokes in the plot window, turns them into labels in the core > >> code, and >>> then >>>> replots with the new label. If the demo works, it shows that >> keycodes >>> including >>>> the space-key are correctly transmitted to the core code. >>>> >>>> Ethan >>> >>> The mouselabels demo does work* on Windows in wxt and windows terms, >>> although one cannot create a label containing a space (because the >>> space brings up the console) or q (it is ignored). >>> >>> * for some value of "works"... The Windows terminal tends to > eat >>> keystrokes unless they're typed much more slowly than a normal > typing >>> pace. The wxt terminal places the red text on top of the black, making >>> it impossible to read either, and sometimes (I haven't figured out > how >>> to replicate it on-demand) backspace doesn't work. Both seem to > add an >>> extra "\033" label after hitting ESC to end label input. > None >> of >>> the >>> Windows builds have a qt terminal to try. >> >> >> Tait is right. >> For qt on windows, mouselabels demo does not work. >> >> As the first work, I will try to mouselabels demo to wrok on qt for > windows. >> >> Tatsuro > > > I misled the mouselabels demo, I have execute it on wxt and windows terminmal on > windows. > That worked but echo back 'paused' to the command screen at each key > stoke. > This is not a bug but it is annoying. > > I have execute mouselabels demo on qt terminal on Ubuntu 12.04 LTS. > > It partially work. Key input reflected in the plot window. > However, <del>, <bs> and <esc> work but <tab> does not > work. > > The qt terminal seems to have bug for key input handling but behave differently > on windows and Linux. > > Regards > This is just information. On plot window of qt term 0n windows, key command like "h", "p" is effective so that communication of qt terminal to gnuplot is effective. So it is strange why mouselabels demo does not work at all on the qt terminal on windows. Tatsuro |
|
From: sfeam <sf...@us...> - 2014-06-24 04:13:50
|
On Tuesday, 24 June 2014 12:15:07 PM Tatsuro MATSUOKA wrote: > > It partially work. Key input reflected in the plot window. > > However, <del>, <bs> and <esc> work but <tab> does not > > work. The <tab> key is not normally available to Qt apps, with some exceptions like text-entry widgets. It is trapped by the Qt top layer and normally interpreted as a request to switch focus to the next Qt widget. I suppose this made sense when Qt was mostly being used as a phone O/S but it's really annoying on the desktop. The closest I could find to a clue how to work around this was this thread: http://stackoverflow.com/questions/18160051/intercepting-tab-key-press-to-manage-focus-switching-manually I did not try to add this to gnuplot, however, so I don't know whether it would work for us or not. Ethan > > The qt terminal seems to have bug for key input handling but behave differently > > on windows and Linux. > > > > Regards > > > This is just information. > On plot window of qt term 0n windows, key command like "h", "p" is effective > so that communication of qt terminal to gnuplot is effective. > So it is strange why mouselabels demo does not work at all on the qt terminal on windows. > > Tatsuro |
|
From: Tatsuro M. <tma...@ya...> - 2014-06-24 09:32:40
|
----- Original Message ----- > From: sfeam > To: gnuplot-beta Tatsuro MATSUOKA> > Date: 2014/6/24, Tue 13:12 > Subject: Re: How to get key information from qt terminal to gnuplot > > On Tuesday, 24 June 2014 12:15:07 PM Tatsuro MATSUOKA wrote: > >> > It partially work. Key input reflected in the plot window. >> > However, <del>, <bs> and <esc> work but <tab> > does not >> > work. > > The <tab> key is not normally available to Qt apps, with some exceptions > like text-entry widgets. It is trapped by the Qt top layer and normally > interpreted as a request to switch focus to the next Qt widget. > I suppose this made sense when Qt was mostly being > used as a phone O/S but it's really annoying on the desktop. > The closest I could find to a clue how to work around this was this > thread: > > http://stackoverflow.com/questions/18160051/intercepting-tab-key-press-to-manage-focus-switching-manually > > I did not try to add this to gnuplot, however, so I don't > know whether it would work for us or not. > > Ethan Thank you for the pointer. According to the first answer on the web page above, I added QWidget::setFocusPolicy( Qt::NoFocus); //trial to the top of void QtGnuplotScene::keyPressEvent(QKeyEvent* event) in QtGnuplotWidget.cpp. I have met the error: QtGnuplotScene.cpp:881:38: error: cannot call member function 'void QWidget::setFocusPolicy(Qt::FocusPolicy)' without object I do not have enough knowldege for C++ so that I cannot understand what the error message means. I should make a mistake but I cannot find out what am I wrong. Sorry for my ignorance for this matter. Tatsuro |
|
From: Jérôme L. <lod...@us...> - 2014-06-24 10:04:23
|
Hi, I did not really follow what you want to achieve, but the error message tells that you have to specify on which widget you want to set the focus policy. If you want to set the policy of the QtGnuplotWidget containing the scene, you might try m_widget->setFocusPolicy( Qt::NoFocus); Jérôme Le 24/06/2014 11:32, Tatsuro MATSUOKA a écrit : > ----- Original Message ----- > >> From: sfeam >> To: gnuplot-beta Tatsuro MATSUOKA> >> Date: 2014/6/24, Tue 13:12 >> Subject: Re: How to get key information from qt terminal to gnuplot >> >> On Tuesday, 24 June 2014 12:15:07 PM Tatsuro MATSUOKA wrote: >> >>> > It partially work. Key input reflected in the plot window. >>> > However, <del>, <bs> and <esc> work but <tab> >> does not >>> > work. >> >> The <tab> key is not normally available to Qt apps, with some exceptions >> like text-entry widgets. It is trapped by the Qt top layer and normally >> interpreted as a request to switch focus to the next Qt widget. >> I suppose this made sense when Qt was mostly being >> used as a phone O/S but it's really annoying on the desktop. >> The closest I could find to a clue how to work around this was this >> thread: >> >> http://stackoverflow.com/questions/18160051/intercepting-tab-key-press-to-manage-focus-switching-manually >> >> I did not try to add this to gnuplot, however, so I don't >> know whether it would work for us or not. >> >> Ethan > > Thank you for the pointer. > > According to the first answer on the web page above, I added > > QWidget::setFocusPolicy( Qt::NoFocus); //trial > to the top of void QtGnuplotScene::keyPressEvent(QKeyEvent* event) > in QtGnuplotWidget.cpp. > > I have met the error: > > QtGnuplotScene.cpp:881:38: error: cannot call member function 'void QWidget::setFocusPolicy(Qt::FocusPolicy)' without object > > I do not have enough knowldege for C++ so that I cannot understand what the error message means. > I should make a mistake but I cannot find out what am I wrong. > > Sorry for my ignorance for this matter. > > Tatsuro > > ------------------------------------------------------------------------------ > Open source business process management suite built on Java and Eclipse > Turn processes into business applications with Bonita BPM Community Edition > Quickly connect people, data, and systems into organized workflows > Winner of BOSSIE, CODIE, OW2 and Gartner awards > http://p.sf.net/sfu/Bonitasoft > _______________________________________________ > gnuplot-beta mailing list > gnu...@li... > Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-beta > |
|
From: Tatsuro M. <tma...@ya...> - 2014-06-24 10:30:07
|
----- Original Message ----- > From: Jérôme Lodewyck > To: Tatsuro MATSUOKA ; gnuplot-beta > Cc: > Date: 2014/6/24, Tue 18:42 > Subject: Re: How to get key information from qt terminal to gnuplot > > Hi, > > I did not really follow what you want to achieve, but the error message > tells that you have to specify on which widget you want to set the focus > policy. If you want to set the policy of the QtGnuplotWidget containing > the scene, you might try > > m_widget->setFocusPolicy( Qt::NoFocus); Jérôme Thank you for the reply!! I have executed mouselabels demo on qt terminal on Ubuntu 12.04 LTS. It partially work. Key input reflected in the plot window. However, <del>, <bs> and <esc> work but <tab> does not work. For the above fact, Ethan show the thread concering tab key http://stackoverflow.com/questions/18160051/intercepting-tab-key-press-to-manage-focus-switching-manually The first answer for the question says that : Using setFocusPolicy( Qt::NoFocus) property of QWidget, one can set Focus policy on widget which doesn't require tab focus. I thought that I could get tab code using setFocusPolicy( Qt::NoFocus). Using m_widget->setFocusPolicy( Qt::NoFocus); instead of QWidget::setFocusPolicy( Qt::NoFocus); I could complie QtGnuplotWidget.cpp and got gnuplot_qt. However, tab key feature does not work on mouselabels demo (demo/mouselabels.dem) on qt term. Perhaps I have misled the answer of the question. If you have an idea to tab key to work on the plot window in qt terminal please show the way. Tatsuro |
|
From: Tatsuro M. <tma...@ya...> - 2014-06-25 08:23:35
|
----- Original Message ----- > From: Ethan A Merritt > To: gnuplot-beta; Tatsuro MATSUOKA > Cc: > Date: 2014/6/24, Tue 04:55 > Subject: Re: How to get key information from qt terminal to gnuplot > > On Tuesday, 24 June, 2014 04:49:36 Tatsuro MATSUOKA wrote: >> >> ----- Original Message ----- >> > From: sfeam >> > To: gnuplot-beta >> > Cc: Petr Mikulik >> > Date: 2014/6/23, Mon 14:52 >> > Subject: Re: How to get key information from qt terminal to gnuplot >> > >> Although Ethan's idea is attractive, I will try console raise feature > for qt terminal by Petr's way at this moment. >> To implement Ethan's idea, we have to have wrapper function to get > keycode. >> This is because each terminal implements the way to get keycode diffident > way and keycode map for each the terminal is different (especially of windows). >> >> I will wait that someone who has good knowledge inter platform try to > implement. > > Isn't it true that all terminals already do the necessary key-code > processing so that they can send key events to the core code in mouse.c? > > For example, does "mouselabels.dem" work on MSWin? That demo reads > keystrokes in the plot window, turns them into labels in the core code, and then > replots with the new label. If the demo works, it shows that keycodes > including > the space-key are correctly transmitted to the core code. I have a look into this issue a little deeper. Currently terminal raise and lower commands are treated in command.c The treatment for OS2, X11, Windows and WXWIDGETS is managed in void raise_lower_command(int lower) I do know the reason why but those are written in command.c but not mouse.c. Tatsuro |
|
From: Petr M. <mi...@ph...> - 2014-06-25 08:43:48
|
> I have a look into this issue a little deeper. > Currently terminal raise and lower commands are treated in command.c > > The treatment for OS2, X11, Windows and WXWIDGETS is managed in > > void > raise_lower_command(int lower) > > I do know the reason why but those are written in command.c but not mouse.c. Because these are gnuplot command line commands: gnuplot> raise gnuplot> lower to raise/lower the terminal window (not the console window). --- Petr |
|
From: Tatsuro M. <tma...@ya...> - 2014-06-25 10:51:26
|
----- Original Message ----- > From: Petr Mikulik > To: Tatsuro MATSUOKA > Cc: Merritt Ethan ; gnuplot-beta > Date: 2014/6/25, Wed 17:43 > Subject: Re: How to get key information from qt terminal to gnuplot > >> I have a look into this issue a little deeper. >> Currently terminal raise and lower commands are treated in command.c >> >> The treatment for OS2, X11, Windows and WXWIDGETS is managed in >> >> void >> raise_lower_command(int lower) >> >> I do know the reason why but those are written in command.c but not > mouse.c. > > Because these are gnuplot command line commands: > gnuplot> raise > gnuplot> lower > > to raise/lower the terminal window (not the console window). Thanks! I completely misled the situation. I checked this feature for the qt on windows and it did not work as expected. This feature is better to be implemented for qt terminal. Tatsuro |
|
From: Tatsuro M. <tma...@ya...> - 2014-07-01 10:48:07
Attachments:
mouse.c.diff
|
In the gnuplot manual for 4.6 and 5.0rc-1, the below is described in the qt terminal subsection. By default, the window is raised to the top of your desktop when a plot is drawn. This can be controlled with the keyword "raise". The keyword "persist" will prevent gnuplot from exiting before you explicitely close all the plot windows. Finally, by default the key <space> raises the gnuplot console window, and 'q' closes the plot window. The keyword "ctrl" allows you to replace those bindings by <ctrl>+<space> and <ctrl>+'q', respectively. However, no codes are described for "key <space> raises the gnuplot console window" so far. I have tried to revise mouse.c for qt (only for windows) as Ethan was suggested. I build patched binary with debug option and traced with gdb. The space key code is trasfered to mouse.c by pressing space key on plot windows and WinRaiseConsole() is executed. But without break, pressing space key on plot windows did not raise console. Perhaps I have misled but I cannot find where is wrong. Anyway, I think that the situation is not much with the manual for qt terminal concerning raise console feature. If I am misleading the situation, please pointed it out. Tatsuro |