|
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! |