dMZX Forums: SDL doesn't have an easy way to distinguish Alt+key presses from AltGr+key presses -> MegaZeux Bugs -> Tracker

Jump to content

Report ID 798 Title SDL doesn't have an easy way to distinguish Alt+key presses from AltGr+key presses
Product MegaZeux Bugs Status Dependency Flaw (Severity 3 - Medium)
Version 2.92c Fixed in -
Introduced In Version 2.80XOperating System All platforms

Page 1 of 1
  • Cannot start a new Issue
  • You cannot reply to this issue

Report ID #798: SDL doesn't have an easy way to distinguish Alt+key presses from AltGr+key presses

#1 User is online  
Lachesis 

  • the pinnacle of human emotion
  • Group: DigiStaff
  • Posts: 3,949
  • Joined: 17-July 04
  • Gender:Female
  • Location:Sealand

Posted 11 March 2020 - 08:48 PM

SDL doesn't provide an easy way to distinguish Alt from AltGr when using a keyboard locale with AltGr. This means that combinations such as "AltGr+S" in the robot editor would mark the start of the block instead of printing whatever char AltGr+S represents to the buffer.

I'm not sure how important this is since AltGr combinations are almost always Unicode glyphs and are blocked in most places MZX uses text. This pull request fixes robot editor issues related to this with key combinations that aren't bound by the robot editor.
"Let's just say I'm a GOOD hacker, AND virus maker. I'm sure you wouldn't like to pay for another PC would you?"

xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository


Page 1 of 1  
  • Cannot start a new Issue
  • You cannot reply to this issue

Replies (1 - 5)

#2 User is online  
Lachesis 

  • the pinnacle of human emotion
  • Group: DigiStaff
  • Posts: 3,949
  • Joined: 17-July 04
  • Gender:Female
  • Location:Sealand

Posted 11 November 2024 - 05:04 AM

Updating severity to: 3 - Medium

Bumping up the severity as required glyphs in Robotic may be available only via AltGr, dead key, or compose shortcuts. As far as I can tell compose-style text entry for KDE Plasma (built-in XCompose support) and Windows (WinCompose) bypass this problem, but that's not a universal solution.
"Let's just say I'm a GOOD hacker, AND virus maker. I'm sure you wouldn't like to pay for another PC would you?"

xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository

#3 User is online  
Lachesis 

  • the pinnacle of human emotion
  • Group: DigiStaff
  • Posts: 3,949
  • Joined: 17-July 04
  • Gender:Female
  • Location:Sealand

Posted 11 November 2024 - 05:07 AM

Related SDL 3.x ticket.
"Let's just say I'm a GOOD hacker, AND virus maker. I'm sure you wouldn't like to pay for another PC would you?"

xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository

#4 User is online  
Lachesis 

  • the pinnacle of human emotion
  • Group: DigiStaff
  • Posts: 3,949
  • Joined: 17-July 04
  • Gender:Female
  • Location:Sealand

Posted 06 April 2025 - 10:44 AM

Needs more testing, but in Windows at least, SDL3 (and probably SDL2) won't send an SDL_EVENT_TEXT_INPUT when pressing modifier + key unless it happens to be something like AltGr.

Unfortunately, SDL_EVENT_TEXT_INPUT is impossible to synchronize with MegaZeux's built-in auto repeat, so making text take precedence over keycodes wouldn't help if AltGr + key is held.
"Let's just say I'm a GOOD hacker, AND virus maker. I'm sure you wouldn't like to pay for another PC would you?"

xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository

#5 User is online  
Lachesis 

  • the pinnacle of human emotion
  • Group: DigiStaff
  • Posts: 3,949
  • Joined: 17-July 04
  • Gender:Female
  • Location:Sealand

Posted 09 April 2025 - 04:12 AM

Windows 10 Home: right alt always sends SDLK_RALT and sets SDL_KMOD_RALT.
Fedora 41 KDE: right alt sends SDLK_RALT and sets SDL_KMOD_RALT in a regular layout, sends SDLK_MODE and sets SDL_KMOD_MODE in an AltGr layout.
"Let's just say I'm a GOOD hacker, AND virus maker. I'm sure you wouldn't like to pay for another PC would you?"

xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository

#6 User is online  
Lachesis 

  • the pinnacle of human emotion
  • Group: DigiStaff
  • Posts: 3,949
  • Joined: 17-July 04
  • Gender:Female
  • Location:Sealand

Posted 13 April 2025 - 01:12 AM

Fixed about as much as reasonably possible given the constraints provided by SDL (and probably forced by the OSes) in GIT 752fc09a and GIT 97d74e6c:

  • Wayland/X11 AltGr now reports as keycode 313 so it's at least detectable by MegaZeux now. Not sure if this will change in any capacity but I don't like having such OS/keyboard-specific keys. Right Alt is downgraded to a warning key in keycodes.html.
  • Added configuration options "key_right_alt_is_altgr" and "key_left_alt_is_altgr" so users that rely on AltGr can prevent these keys from triggering shortcuts. Both should probably be enabled by default for macOS in the future. Should probably be enabled for right Alt by default in Haiku, but needs verification.
  • All places that take text input should now require exact modifiers for shortcuts. This allows the use of Ctrl+Alt as AltGr in Windows (but doesn't help very much with right Alt AltGr, or with other OSes).

It may be possible to do more at a later date depending on however the linked SDL issue goes, so this issue can sleep until then.
"Let's just say I'm a GOOD hacker, AND virus maker. I'm sure you wouldn't like to pay for another PC would you?"

xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository


Page 1 of 1
  • Cannot start a new Issue
  • You cannot reply to this issue

1 User(s) are reading this issue
1 Guests and 0 Anonymous Users


Powered by IP.Tracker 1.3.2 © 2025  IPS, Inc.