How to input the arrow keys when debugging

CodeLite installation/troubleshooting forum
User avatar
falao84
CodeLite Curious
Posts: 3
Joined: Wed Apr 09, 2014 9:22 am
Genuine User: Yes
IDE Question: C++
Contact:

How to input the arrow keys when debugging

Post by falao84 » Wed Apr 09, 2014 10:08 am

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.

User avatar
eranif
CodeLite Plugin
Posts: 6110
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: How to input the arrow keys when debugging

Post by eranif » Wed Apr 09, 2014 11:40 am

Does it work without the debugger?

Eran
Make sure you have read the HOW TO POST thread

User avatar
falao84
CodeLite Curious
Posts: 3
Joined: Wed Apr 09, 2014 9:22 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: How to input the arrow keys when debugging

Post by falao84 » Thu Apr 10, 2014 8:26 am

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.

Jarod42
CodeLite Expert
Posts: 190
Joined: Wed Sep 30, 2009 5:54 pm
Genuine User: Yes
IDE Question: C++
Location: France
Contact:

Re: How to input the arrow keys when debugging

Post by Jarod42 » Thu Apr 10, 2014 11:01 am

I would say that one terminal send special character for arrow key (something like ^[[A if I remember correctly).

User avatar
eranif
CodeLite Plugin
Posts: 6110
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: How to input the arrow keys when debugging

Post by eranif » Thu Apr 10, 2014 1:47 pm

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
Make sure you have read the HOW TO POST thread

User avatar
falao84
CodeLite Curious
Posts: 3
Joined: Wed Apr 09, 2014 9:22 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: How to input the arrow keys when debugging

Post by falao84 » Fri Apr 11, 2014 6:10 am

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.

Post Reply