Skip to content

Formspec: Implement Ctrl+Shift+Left/Right text selection - #16455

Merged
SmallJoker merged 1 commit into
luanti-org:masterfrom
SmallJoker:pr_16455_edit_box_ctrl_select
Sep 4, 2025
Merged

SmallJoker merged 1 commit into
luanti-org:masterfrom
SmallJoker:pr_16455_edit_box_ctrl_select

Conversation

@SmallJoker

Copy link
Copy Markdown
Member

This is a quality-of-life improvement to edit text more easily. Here I tried to mimic the logic of Firefox.

This does NOT implement text selection of single-line input boxes. This shall be addressed by merging GUIEditBox into CGUIEditBox in a future PR. (yes we have some duplicate code)

To do

This PR is Ready for Review.

How to test

  1. Either use the server list description box to navigate, or edit mainmenu/tab_local.lua:
	elseif is_world_selected then
		retval = retval ..
				"button[10.1875,5.925;4.9375,0.8;play;" .. fgettext("Play Game") .. "]"
	end

local text = [[
01""field[0,".. y .. ";3,0.75;te_serveraddr;"
02      download .doc file (zipped)
03https://a.domain.tld/word-bar/aaa.jpeg?key_text=value%20what%20ever
04 AAA000... AA00.. A0. A. .A .A0
05
06頂とょんき回独サ午映就
07Chuchichäschtli
08
09
10
11
12
13
]]
	--text = "sasasas aaaa dd"

	retval = "textarea[1,1;8,3;mytext;Title Name;" .. core.formspec_escape(text) .. "]"

	return retval
  1. Use the Shift+Left/Right, Ctrl+Shift+Left/Right key combinations to select text.
  2. It must feel rather consistent with other apps.

This is a quality-of-life improvement to edit text more easily.
@SmallJoker

Copy link
Copy Markdown
Member Author

(The build shows up as fail because the macOS dependencies could not be installed properly.)

@Zughy Zughy added the Roadmap The change matches an item on the current roadmap label Aug 30, 2025

@sfan5 sfan5 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

works

@SmallJoker
SmallJoker merged commit d24a700 into luanti-org:master Sep 4, 2025
15 of 17 checks passed
mjz19910 pushed a commit to mjz19910/luanti that referenced this pull request Mar 9, 2026
…16455)

This is a quality-of-life improvement to edit text more easily.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

@ Client / Controls / Input Feature ✨ PRs that add or enhance a feature Formspec One approval ✅ ◻️ Roadmap The change matches an item on the current roadmap

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants