Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Meta-, does nothing in TEdit with an Italian keyboard on Linux #1985

Open
pamoroso opened this issue Jan 22, 2025 · 24 comments
Open

Meta-, does nothing in TEdit with an Italian keyboard on Linux #1985

pamoroso opened this issue Jan 22, 2025 · 24 comments

Comments

@pamoroso
Copy link
Contributor

Describe the bug

In TEdit, pressing Meta-, moves the caret left and Meta-. right by one character. But pressing Meta-, on my italian keyboard does nothing and the caret doesn't move. Meta-. works as expected.

To Reproduce

Steps to reproduce the behavior:

  1. launch Medley
  2. open TEdit
  3. type one word
  4. place the caret at the center of the word
  5. press Meta-, on an Italian keyboard

Expected behavior

The caret moves left by one character.

Screenshots

N/A

Context (please complete the following information):

  • Are you using online.interlisp.org? no
  • OS: Linux
  • OS Version: Mint 22 Cinnamon
  • Display/window system: X11 + VNC
  • Host arch: x86_64 (System76 Merkaat)
  • Maiko version: 3c4d9f5393e56857d1e75352f8d8d0a0c9d91e01
  • IL:MAKESYSDATE: 21-Jan-2025 04:48:26

Additional context

The output of xev when , is pressed:

KeyPress event, serial 28, synthetic NO, window 0x4200001,
    root 0x5cf, subw 0x4200002, time 39556239, (45,22), root:(110,825),
    state 0x0, keycode 59 (keysym 0x2c, comma), same_screen YES,
    XLookupString gives 1 bytes: (2c) ","
    XmbLookupString gives 1 bytes: (2c) ","
    XFilterEvent returns: False

KeyRelease event, serial 28, synthetic NO, window 0x4200001,
    root 0x5cf, subw 0x4200002, time 39556351, (45,22), root:(110,825),
    state 0x0, keycode 59 (keysym 0x2c, comma), same_screen YES,
    XLookupString gives 1 bytes: (2c) ","
    XFilterEvent returns: False

This issue may be related to the behavior of the < key on my keyboard described in #1828.

@rmkaplan
Copy link
Contributor

rmkaplan commented Jan 22, 2025 via email

@pamoroso
Copy link
Contributor Author

Do I need the keycode reported by xev? Something like this?

(TEDIT.SETFUNCTION “Meta,keycode" (FUNCTION \TEDIT.ONECHAR.BACKWARD))

@rmkaplan
Copy link
Contributor

rmkaplan commented Jan 22, 2025 via email

@pamoroso
Copy link
Contributor Author

When I call WHICHKEY and press Meta-, the function prints #1,4 and returns NIL. Not sure if I'm using it correctly.

@rmkaplan
Copy link
Contributor

rmkaplan commented Jan 23, 2025 via email

@pamoroso
Copy link
Contributor Author

If I press just the comma WHICHKEY prints , and returns NIL.

@nbriggs
Copy link
Contributor

nbriggs commented Jan 23, 2025

@pamoroso you have to hold the comma (or any other key) down immediately after starting (WHICHKEY) until it returns either a key or a list of keys, or NIL

@pamoroso
Copy link
Contributor Author

Thanks, I was doing it wrong. When pressing and holding Meta-, WHICHKEY prints (%, <) and returns #1,4. With just , it prints (%, <) and returns ,.

@nbriggs
Copy link
Contributor

nbriggs commented Jan 23, 2025

You're holding down two keys (meta and comma) - WHICHKEY finds the first physical key in the list \KEYNAMES for which (KEYDOWNP keyname) is true.

@nbriggs
Copy link
Contributor

nbriggs commented Jan 23, 2025

Running on macOS, with TEDIT dated 11-Jan-2025, on a US keyboard, Meta-, does nothing but Meta-. advances the caret by TWO characters.

@nbriggs
Copy link
Contributor

nbriggs commented Jan 23, 2025

BUT... that is inconsistent, it seems to depend on where in the display the line with the caret is.

@pamoroso
Copy link
Contributor Author

I misunderstood WHICHKEY again and assumed it also accepts key combinations. Calling the function (hopefully) correctly it returns (BLANK-TOP KEYBOARD DBK-META) when pressing Alt. It returns (%, <) and prints , when pressing ,.

@nbriggs
Copy link
Contributor

nbriggs commented Jan 23, 2025

Then your keyboard has the expected behavior. You're using ldex or ldesdl?

@pamoroso
Copy link
Contributor Author

I'm using ldex, I haven't been building for SDL since using VNC.

@rmkaplan
Copy link
Contributor

rmkaplan commented Jan 24, 2025 via email

@rmkaplan
Copy link
Contributor

rmkaplan commented Jan 24, 2025 via email

@pamoroso
Copy link
Contributor Author

Pressing Meta-, with the updated WHICHKEY returns ((%, <) (BLANK-TOP KEYBOARD DBK-META)).

@rmkaplan
Copy link
Contributor

rmkaplan commented Jan 24, 2025 via email

@nbriggs
Copy link
Contributor

nbriggs commented Jan 24, 2025

For me, tracing on:

\TEDIT.ONECHAR.BACKWARD gets called each time I type meta-,
If I started with a single character selected then it goes from SEL 11-1-R to SEL 11-0-R the 1st time, then it stays at SEL 11-0-R after that. It never moves the caret, but it deselects the character. Same with word selection - it just deselects but doesn't move. If it was a blue selection, it seems to forget that it should be un-blued.
\TEDIT.ONECHAR.FORWARD gets called once each time I type meta-.
The selection in the call advances by two each time, and the caret position moves.
SEL: 3-1-R _ then SEL: 5-0-R _, then SEL: 7-0-R _ and so on. But then I try again with a different starting point and it advances properly, 7-0-L, 8-0-L -- ah I see the pattern: if it's an "R" it goes by two, if an "L" then by one.

@nbriggs
Copy link
Contributor

nbriggs commented Jan 24, 2025

(and the same for the one character backward - an L selection works, an R selection doesn't)

@pamoroso
Copy link
Contributor Author

It still doesn't work for the Italian keyboard. But, weirdly, moving the caret left with Meta-, does work after tracing both \TEDIT.ONECHAR.FORWARD and \TEDIT.ONECHAR.BACKWARD. Tracing only the former is not enough for Meta-, to move the caret. Meta-. already worked and still works under tracing.

This is the trace output after Meta-, followed by Meta-.:

Image

@pamoroso
Copy link
Contributor Author

I did a few more tests and Meta-, seems to be working fine even without tracing \TEDIT.ONECHAR.FORWARD.

I'm using a 2-Jan-2025 07:29:14 loadup, which is the only working one I have because of #1986. I'm reasonably sure Meta-, didn't seem to work with the exact same loadup. Go figure.

@pamoroso
Copy link
Contributor Author

I did more tests and these are my observations.

Sometimes Meta-, works, others not and there doesn't seem to be a pattern. Tracing \TEDIT.ONECHAR.FORWARD is not a requirement. At times Meta-, doesn't work but placing the caret elsewhere makes it work.

This is the only behavior I can reproduce:

  • Meta-, does nothing when the caret is immediately after the last character of a word such as in word^
  • Meta-. does nothing when the caret is immediately before the last character of a word such as in wor^d

@nbriggs
Copy link
Contributor

nbriggs commented Jan 24, 2025

@pamoroso - see my note about whether it's a Left or Right selection, 5 and 4 comments back from this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants