TMemo WantReturns=False Fails on Linux lazarus / 31-LCL ---------------------------------------------------------------------- msintle · 2024-03-30 18:38 Expected behavior: When WantReturns is FALSE, Ctrl+Enter still enters a new line in TMemo. Actual behavior: Ctrl+Enter does nothing. The expected behavior is realized properly on Windows and macOS. Any thoughts for fixes and/or workarounds? ---------------------------------------------------------------------- jamie · 2024-03-30 19:06 Must be one of those forgotten features. what Widget are you using ? ---------------------------------------------------------------------- Thaddy · 2024-03-30 19:12 i suspect a hardcoded #13#10 instead of LineEnding. Not the Tmemo at fault. ---------------------------------------------------------------------- msintle · 2024-04-02 11:17 Quote from: jamie on March 30, 2024, 08:06:39 pmMust be one of those forgotten features. what Widget are you using ? Reproduces equally with both Qt5 and GTK2. ---------------------------------------------------------------------- msintle · 2024-04-02 11:18 Quote from: Thaddy on March 30, 2024, 08:12:24 pmi suspect a hardcoded #13#10 instead of LineEnding. Not the Tmemo at fault. Pressing the Enter key works fine when WantReturns=True. It is only Ctrl+Enter that fails when WantReturns=False. ---------------------------------------------------------------------- AlexTP · 2024-04-02 11:42 Seems you need to handle CTRL+Enter by hands. It is not handled by native Memo code on Windows. ---------------------------------------------------------------------- rvk · 2024-04-02 12:05 Isn't this just default behavoir? The WantReturns is only for the Enter. Even in Delphi this is the case. QuoteNote: If WantReturns is false, users can still enter return characters into the text by pressing Ctrl+Enter.https://docwiki.embarc adero.com/Libraries/Sydney/en/API:Vcl.StdCtrls.TMemo.WantReturns O, and this is also documented for Lazarus: QuoteThe Enter key is normally used to press the default button in a form, so it cannot be used to add line breaks into the text by default. Set WantReturns to True to allow line breaks to be entered using Enter when the control has the input focus. Ctrl+Enter can be used to insert a line break, even if WantReturns is set to False.https://lazarus- ccr.sourceforge.io/docs/lcl/stdctrls/tcustommemo.wantreturns.html ---------------------------------------------------------------------- msintle · 2024-04-03 12:32 Quote from: AlexTP on April 02, 2024, 01:42:34 pmSeems you need to handle CTRL+Enter by hands. It is not handled by native Memo code on Windows. Not sure what the confusion is. Ctrl+Enter works perfectly fine on both Windows and macOS when WantReturns=False. It only fails on Linux. Are you saying it fails on Windows, which is definitely not the case? ---------------------------------------------------------------------- msintle · 2024-04-03 12:33 Quote from: rvk on April 02, 2024, 02:05:35 pmIsn't this just default behavoir? The WantReturns is only for the Enter. Even in Delphi this is the case. QuoteNote: If WantReturns is false, users can still enter return characters into the text by pressing Ctrl+Enter.https://docwiki.embarc adero.com/Libraries/Sydney/en/API:Vcl.StdCtrls.TMemo.WantReturns O, and this is also documented for Lazarus: QuoteThe Enter key is normally used to press the default button in a form, so it cannot be used to add line breaks into the text by default. Set WantReturns to True to allow line breaks to be entered using Enter when the control has the input focus. Ctrl+Enter can be used to insert a line break, even if WantReturns is set to False.https://lazarus- ccr.sourceforge.io/docs/lcl/stdctrls/tcustommemo.wantreturns.html I don't understand what you're trying to say. Ctrl+Enter does NOT enter a new line in a TMemo control on Linux ONLY when WantReturns is FALSE. ---------------------------------------------------------------------- rvk · 2024-04-03 13:30 Quote from: msintle on April 03, 2024, 02:33:14 pmCtrl+Enter does NOT enter a new line in a TMemo control on Linux ONLY when WantReturns is FALSE. Ha, then I misunderstood. Yes. It seems like the CTRL+Enter is also blocked when setting WantReturns to false. That's a bug. The weird part is... Alt+Enter does still work ---------------------------------------------------------------------- msintle · 2024-04-06 18:25 Quote from: rvk on April 03, 2024, 03:30:52 pmQuote from: msintle on April 03, 2024, 02:33:14 pmCtrl+Enter does NOT enter a new line in a TMemo control on Linux ONLY when WantReturns is FALSE. Ha, then I misunderstood. Yes. It seems like the CTRL+Enter is also blocked when setting WantReturns to false. That's a bug. The weird part is... Alt+Enter does still work  That is a brilliant workaround - thanks Edit - Spoke too soon Doesn't work on, for example, Kali 23 with Qt5 Lazarus! Any thoughts on what a proper fix for this problem would entail? ---------------------------------------------------------------------- rvk · 2024-04-07 19:50 Quote from: msintle on April 06, 2024, 08:25:24 pmQuote from: rvk on April 03, 2024, 03:30:52 pmThe weird part is... Alt+Enter does still work  That is a brilliant workaround - thanks Edit - Spoke too soon Doesn't work on, for example, Kali 23 with Qt5 Lazarus! Any thoughts on what a proper fix for this problem would entail? The problem is that Qt5 doesn't support the Alt+Enter trick. If you want either one (Alt+Enter or Ctrl+Enter) to work in Qt5 you would need to create a bug report. BTW. Qt5 also doesn't support Ctrl+Enter, even when WantReturns is set to true.