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

Discussion: rename SDL event types? #6877

Closed
slouken opened this issue Dec 23, 2022 · 7 comments · Fixed by #7136
Closed

Discussion: rename SDL event types? #6877

slouken opened this issue Dec 23, 2022 · 7 comments · Fixed by #7136
Milestone

Comments

@slouken
Copy link
Collaborator

slouken commented Dec 23, 2022

Half related to #6869 #6772 . but shouldn't then event be named more like SDL_EVENT_* :
SDL_EVENT_WINDOW_CLOSE for instance, instead of SDL_WINDOWEVENT_CLOSE.

Originally posted by @1bsyl in #6871 (comment)

@slouken slouken added this to the 3.2.0 milestone Dec 23, 2022
@AntTheAlchemist
Copy link
Contributor

Why not SDL_WINDOW_CLOSE?

_CLOSE is a bad example, but makes more sense for the other events, eg SDL_WINDOW_HIDDEN.

@1bsyl
Copy link
Contributor

1bsyl commented Dec 23, 2022

could be "CLOSED"
but for instance SDL_WINDOW_SHOWN is already a Window Flags. and it SDL_WINDOWEVENT_SHOWN is an event.

@icculus
Copy link
Collaborator

icculus commented Dec 23, 2022

SDL_WINDOW_SHOWN is already a Window Flags.

As is SDL_WINDOW_HIDDEN (although I'm about to open a bug about both of these existing).

I do worry that we're making these too verbose, but having everything prefixed with SDL_EVENT_* wouldn't be the worst thing.

@1bsyl
Copy link
Contributor

1bsyl commented Dec 23, 2022

I do worry that we're making these too verbose, but having everything prefixed with SDL_EVENT_* wouldn't be the worst thing.

not sure to get the sense of the sentence :) ? are you in favor of SDL_EVENT_* or not ?

  • adding SDL_EVENT_ is verbose, but it helps to discriminate ...
  • maybe, only for the window Event. (eg changing SDL_WINDOWEVENT to SDL_EVENT_WINDOW)
    without touching SDL_QUIT, SDL_KEYDOWN, etc.
  • SDLE_ ? ( like the SDLK_ we have for keys )

@stianhoiland
Copy link

stianhoiland commented Jan 7, 2023

My 2c: Yes, it should be (re)named SDL_EVENT_*.

@nfries88
Copy link

nfries88 commented Jan 16, 2023

SDLE_ ? ( like the SDLK_ we have for keys )

SDLE_ makes me think error codes, maybe SDLEV_

shorter event names would be an improvement IMO, some of them take like half the screen width on my IDE

@AntTheAlchemist
Copy link
Contributor

I notice "DEVICE" was removed from the gamepad added/removed events, so shouldn't we also do this:

Rename SDL_JOYDEVICEADDED to SDL_JOYSTICKADDED or SDL_JOYADDED
Rename SDL_JOYDEVICEREMOVED to SDL_JOYSTICKREMOVED or SDL_JOYREMOVED

slouken added a commit to slouken/SDL that referenced this issue Jan 24, 2023
slouken added a commit that referenced this issue Jan 24, 2023
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

Successfully merging a pull request may close this issue.

6 participants