Skip to content

Conversation

@sixfourtwelve
Copy link
Contributor

@sixfourtwelve sixfourtwelve commented Jan 5, 2026

My character uses LeftShift to sprint, so I added the missing keys in my local fork and included the other keys that I may potentially use

Copilot AI review requested due to automatic review settings January 5, 2026 13:00
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for modifier keys (LeftShift, RightShift, LeftControl, RightControl) to the keyboard input system by updating both the core keyboard header and the SDL3 keyboard implementation.

  • Adds four new modifier key enums to the Key enumeration
  • Implements bidirectional mapping between SDL3 scancodes and the new Key enums

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/core/include/growl/core/input/keyboard.h Adds four new Key enum values for left/right shift and control modifier keys
src/plugins/sdl3/src/sdl3_keyboard.cpp Implements SDL3 scancode mapping for the new modifier keys in both getKey() and getScancode() functions
Comments suppressed due to low confidence (1)

src/plugins/sdl3/src/sdl3_keyboard.cpp:378

  • The getScancode function is missing a case for Key::Backspace. While Backspace is handled in the getKey function (line 221-222), there is no corresponding case in getScancode. This creates an asymmetry between the two functions - getKey can convert SDL_SCANCODE_BACKSPACE to Key::Backspace, but getScancode cannot convert Key::Backspace back to SDL_SCANCODE_BACKSPACE. This should be added after Key::Escape on line 378 to maintain consistency.
	case Key::Return:
		return SDL_SCANCODE_RETURN;
	case Key::Space:
		return SDL_SCANCODE_SPACE;
	case Key::Escape:
		return SDL_SCANCODE_ESCAPE;

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@JoelOtter JoelOtter changed the title feat: Add missing modifier keys to the keyboard header and sdl3 keyboard [SDL] Add missing modifier keys Jan 5, 2026
@JoelOtter JoelOtter self-requested a review January 5, 2026 22:31
Copy link
Contributor

@JoelOtter JoelOtter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks :) Might revisit these later to handle them as actual modifiers but it's an improvement for now!

@JoelOtter JoelOtter merged commit f8baf81 into Bearwaves:main Jan 6, 2026
12 checks passed
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 this pull request may close these issues.

2 participants