Page 1 of 1

How to input the arrow keys when debugging

Posted: Wed Apr 09, 2014 10:08 am
by falao84
Hello everyone !
I have a C program to identify the keyboard input.
But when debugging, the debugger can not get input from the arrow keys.

CodeLite version : 5.4 (from the CodeLite apt repositories)
OS : debian wheezy
gcc version : 4.7.2
gdb version : 7.4.1

Here is a test source.

Code: Select all

#include <stdio.h>

int main(int argc, char **argv)
{
	int ch;
	while (1)
	{
		ch = getchar();
		printf("ch = %d\n" , ch);    // insert a breakpoint here!
		if (ch == 'q')
		{
			break;
		}
	}
	return 0;
}
I insert a breakpoint to watch the input value, but I cannot input the arrow keys when debugging.
thanks a lot for help.

Re: How to input the arrow keys when debugging

Posted: Wed Apr 09, 2014 11:40 am
by eranif
Does it work without the debugger?

Eran

Re: How to input the arrow keys when debugging

Posted: Thu Apr 10, 2014 8:26 am
by falao84
eranif wrote:Does it work without the debugger?

Eran
Yes. The test program will work well.
But It cannot get arrow key in debug model.

Re: How to input the arrow keys when debugging

Posted: Thu Apr 10, 2014 11:01 am
by Jarod42
I would say that one terminal send special character for arrow key (something like ^[[A if I remember correctly).

Re: How to input the arrow keys when debugging

Posted: Thu Apr 10, 2014 1:47 pm
by eranif
Its probably a limitation with the current terminal emulator that codelite uses
Can you please file a bug report for this?

https://github.com/eranif/codelite/issues/new

Thanks,
Eran

Re: How to input the arrow keys when debugging

Posted: Fri Apr 11, 2014 6:10 am
by falao84
eranif wrote:Its probably a limitation with the current terminal emulator that codelite uses
Can you please file a bug report for this?

https://github.com/eranif/codelite/issues/new

Thanks,
Eran
I have submitted a bug report, but I'm not familiar with the process and format.

I hope it can be improved.