Skip to content

Feat/input text sprite key combo#452

Open
Sn4pe wants to merge 4 commits intotulipjs:masterfrom
Sn4pe:feat/inputTextSprite-key-combo
Open

Feat/input text sprite key combo#452
Sn4pe wants to merge 4 commits intotulipjs:masterfrom
Sn4pe:feat/inputTextSprite-key-combo

Conversation

@Sn4pe
Copy link
Copy Markdown
Contributor

@Sn4pe Sn4pe commented Feb 18, 2025

feat(inputTextSprite): add key combination handlers for word navigation and deletion

  • Implement Alt+ArrowLeft/ArrowRight to jump between words.
  • Implement Alt+Backspace to delete the previous word.
  • Implement Alt+Delete to delete the next word.
  • Use getKeyCombination (based on KeyComboEvent) to detect these combinations.
  • Create keyboard.types.ts to define KeyComboEvent for key combination handling.

Sn4pe and others added 3 commits February 18, 2025 03:17
…ition functions

- Centralize cursor update logic by replacing direct modifications of $cursorIndex with setCursorPosition.
- Update makeActions and key combination handlers to use getCursorPosition for reading the cursor position.
- Update input-text-sprite.types.ts to expose setCursorPosition and getCursorPosition.
…on and deletion

- Implement Alt+ArrowLeft/ArrowRight to jump between words.
- Implement Alt+Backspace to delete the previous word.
- Implement Alt+Delete to delete the next word.
- Use getKeyCombination (based on KeyComboEvent) to detect these combinations.
- Create keyboard.types.ts to define KeyComboEvent for key combination handling.
@pagoru
Copy link
Copy Markdown
Collaborator

pagoru commented Feb 18, 2025

This needs to get the current OS to do it right, because macos works with alt, but the other os work with ctrl

You have the getOS utility to check if it comes from OS.DARWIN or else

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