Coolterm - Enter on keypad sends wrong character

If you have specific questions or problems with any of my Freeware applications, post them here.
Post Reply
Jeff_Birt
Posts: 4
Joined: Fri May 19, 2023 6:07 am

Coolterm - Enter on keypad sends wrong character

Post by Jeff_Birt »

Hi,

Using CoolTerm 2.0.1 on Windows 64bit. I have CoolTerm to send $0D (CR) when Enter is pressed. This works fine when Enter on main keyboard is used. However, the Enter key on the keypad sends $03 (ETX). A friend I am working on a project with is using the Mac version of CoolTerm (same rev#) and does not have this problem.
User avatar
roger
Site Admin
Posts: 431
Joined: Fri Apr 24, 2009 12:41 am
Contact:

Re: Coolterm - Enter on keypad sends wrong character

Post by roger »

Hi Jeff,

MacOS actually differentiates between the "RETURN" and "ENTER" keys. Pressing "RETURN" creates a "Carriage Return" (CR) while pressing "ENTER" sends creates and "End of Text" (ETX) character. So, this is actually expected behavior, at least on macOS. However, I should probably catch any "ENTER" presses and apply the configured emulation regardless of whether RETURN or ENTER is pressed. Look out for the next release!

Roger
Jeff_Birt
Posts: 4
Joined: Fri May 19, 2023 6:07 am

Re: Coolterm - Enter on keypad sends wrong character

Post by Jeff_Birt »

The Windows version has this problem, the MAC version does not.

Also, on the Windows version CTRL+H and CTRL+M are not sent. I have disabled the menu shortcuts, i.e. CTRL+C sends the correct character but CTRL+H and CTRL+M send nothing.
User avatar
roger
Site Admin
Posts: 431
Joined: Fri Apr 24, 2009 12:41 am
Contact:

Re: Coolterm - Enter on keypad sends wrong character

Post by roger »

Yes, I have noticed the same same thing on Windows. CoolTerm simply sends the keystrokes that it receives from the native text control. In the case of CTRL+M and CTRL+H, it doesn't receive ANY keystrokes. I.e. CoolTerm is not even aware that any keys were pressed. Is it possible that Windows traps CTRL+M and CTRL+H, specifically, on a system level and prevents them from being received by a UI control?

There is a workaround, through. You can create macros for the missing control characters and set the preferences to assign the macros to Function keys. that way you can invoke those control characters with functions keys.
Jeff_Birt
Posts: 4
Joined: Fri May 19, 2023 6:07 am

Re: Coolterm - Enter on keypad sends wrong character

Post by Jeff_Birt »

It seems that CTRL+M is an application specific hot key, it should not be trapped globally. Using SPY++ as described here: https://stackoverflow.com/questions/829 ... indows-api I can see that CoolTerm is receiving both the key down and up messages. In fact SPY++ uses both CTRL+M and CTRL+H so you have to have Coolterm in focus to run this test.

It is not a big deal, more of a curiosity.
User avatar
roger
Site Admin
Posts: 431
Joined: Fri Apr 24, 2009 12:41 am
Contact:

Re: Coolterm - Enter on keypad sends wrong character

Post by roger »

Thanks for checking this out. I just wrote a simple test app with only line of code to display the received character in the KeyDown event handler. As it turns out, the KeyDown event never fires for CTRL+H and CTRL+M on windows, while it fires just fine on macOS and Linux. This might be a bug in the IDE I'm using to develop CoolTerm. I'll go ahead and report it and see what happens. It would be nice if that gets fixed.

Meanwhile, CTRL+H is expected to produce a 0x08 character which is BS. You can therefore press backspace and achieve the same effect as pressing CTRL+H. Similarly, CTRL+M is expected produce a 0x0D character or CR. You could change the enter key emulation to use CR.
I will include support for SHIFT and CTLR in combination with ENTER/RETURN in the next CoolTerm build so that other line endings can be sent. With no extra modifier key, pressing enter will send whatever is selected for the enter key emulation. CTRL+ENTER will send CR, SHIFT+ENTER will send LF, and SHIFT+CTRL+ENTER will send CR+LF.
Jeff_Birt
Posts: 4
Joined: Fri May 19, 2023 6:07 am

Re: Coolterm - Enter on keypad sends wrong character

Post by Jeff_Birt »

Just tried the beta. It took care of the key pad enter problem on Windows, I was able to set it to send a CR which works. The alternative keys for CTRL+H and CTRL+M also work. Thanks.
User avatar
roger
Site Admin
Posts: 431
Joined: Fri Apr 24, 2009 12:41 am
Contact:

Re: Coolterm - Enter on keypad sends wrong character

Post by roger »

Great!. Thanks for testing!

BTW, I have opened an issue ticket with Xojo for the problem with CTRL+H and CTRL+M on Windows, and they said it's going to be fixed in the next release of their IDE. Not sure when that's going to be, but hopefully soon. I will wait with the official 2.1.0 release until I get the new IDE so that this will hopefully be a thing of the past.

Roger
User avatar
roger
Site Admin
Posts: 431
Joined: Fri Apr 24, 2009 12:41 am
Contact:

Re: Coolterm - Enter on keypad sends wrong character

Post by roger »

The latest version of the IDE does indeed fix the issue with CTRL+H and CTRL+M on Windows. The new beta I just uploaded was compiled with the updated IDE.
Post Reply