bug-xnee
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-xnee] xnee -rep leaves Control -modifier to pressed state after


From: Veijo Ryhänen
Subject: Re: [Bug-xnee] xnee -rep leaves Control -modifier to pressed state after exiting xnee.
Date: Fri, 13 Jan 2006 11:49:07 +0200

Hello,

thank you for the help. Here are details what  I did:

What happens is:
1) you press Control - xnee saves the Control press
2) you press 'c'- your shell/terminal is sending xnee a signal
3) you release 'c' - xnee is now closing down and therefore not saves
the release
4) you release Control - xnee is now closing down and therefore not
saves the release

So in this case, Control press gets recorded. If Xnee is in a strange
state, you can probably just press and release Control and you'll be OK.

OK, how to solve this then? I see 3 ways now. Perhaps there are more and
even perhaps even smart ways to solve it. But these are the ones I think
of right now.

1) You do it
------------------
Remove the last line in your recorded file (that starts with "0,2,").
This way the Control press isn't played back.

In case of existing file, I did it with nedit -editor.
In case of just recorded file, I do it with edlin -editor:

#!/bin/bash
# This script starts cnee (or older xnee) and removes Ctrl+c problem.
# See details:
# http://lists.gnu.org/archive/html/bug-xnee/2005-07/msg00005.html
# http://lists.gnu.org/archive/html/bug-xnee/2005-04/msg00000.html
# http://lists.gnu.org/archive/html/bug-xnee/2006-01/msg00001.html
# http://lists.gnu.org/archive/html/bug-xnee/2006-01/msg00000.html
#
# $Date: 2006/01/09 13:52:56 $  Veijo Ryhänen, muutokset: $Author: ryhanvei $
# $Revision: 1.1 $

all_parameters=$@
XNEE_BINARY=cnee_binary
CTRL_DOWN="0,2,0,0,0,37,0,"

shift
$XNEE_BINARY $all_parameters

# This function works but is unnecessary!
ignore_Ctrl_button_press_without_release()
{
   last_line=`tail -1 $filename`
   ctrl_without_release=`echo $last_line|grep $CTRL_DOWN`
   if [ $ctrl_without_release ] ; then
      echo "Last line in file $filename contains Ctrl button press without release - ignored."
      # Used ed -editor commands:
      # s = substitute
      # w = write
      # q = quit
      `echo -e "s/$CTRL_DOWN/#$CTRL_DOWN/\nwq"|ed -s $filename`
   fi
}

for param in $all_parameters ; do
   if [ $previous_was_o ] ; then
      filename=$param
      previous_was_o=
      #ignore_Ctrl_button_press_without_release
      # ed edits last line:
      `echo -e "s/$CTRL_DOWN/#$CTRL_DOWN/\nwq"|ed -s $filename`
   fi
   if [ $param = "-o" -o $param = "--out-file" ] ; then
      previous_was_o=1
   fi
done


2) Xnee does it
------------------
This may sound easy. It is not. Cnee has to check how it hawas started
from a terminal and after that check what key combination sends the
signal..... This is not something I think is something that Xnee should
check.

Another thing would be to hold the writing of pressing of modifiers a
bit to see if anything strange is happening (e.g Control C). BUT, what
happens when user presses Alt + Button 1 + moves the mouse. This moves
the window underneath the mouse. Then during replay we do want the press
of Alt to have been recorded, since otherwise the window isn't moved as
when recording. So this is not a solution :(

I did not understand this part well. How about this solution:  cnee and
gnee sends all recorded data to xneed, which is logging daemon. If there is
no data available, then cnee or gnee sends "I am still alive" -message to
the xneed -logging daemon. If xneed does not get any message after timeout
xneed thinks: "cnee or gnee must be dead, propably user has pressed Ctrl+c
si I must comment out the last Ctrl -press and close this log file".
Ctrl+c does not terminate xneed, because it is daemon.


3) use a stop key
------------------
Invoke cnee with the stop key, like this:
   cnee -rec --verbose --keyboard -o a_and_ctrl_c.xnl -sk F1

Then Xnee will stop recording when F1 is pressed. And F1 press or
release will not be recorded*.

It does not work. These stop keys does not work either:
-sk Alt,F1 
-sk Ctrl,F1
-sk Alt,n
-sk Ctrl,n
-sk n
-sk Alt,s
-sk Ctrl,s
-sk s

I haven't enough time to try every combination, so I prefer Ctrl+c, it seems to work allways
perfectly with my script which comment out last Ctrl button press.

> So, it seems to be true that xnee leaves the modifier Control to
> pressed state
> after replay. I fixed this by pressing "Ctrl+c" in my konsole and
> after that my

Control alone would be OK to leave the state.

It does not work. When first pressing c  nothing happens. Second, third
etc... 'c' press will do an empty new line without printing out 'c' character..


Don't know. The corrupt line is something the "xnee replayer" says when
it finds something strange in the recorded file, please send over the
recorded file alone in an attachement.

There is no "Corrupt line" output when using cnee, so this is already fixed.


Veijo Ryhänen

reply via email to

[Prev in Thread] Current Thread [Next in Thread]