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

Add keystroke event support and allow adding text lines to the line editor #1040

Merged
merged 6 commits into from
Mar 26, 2024

Conversation

maxim-productengine
Copy link
Contributor

@maxim-productengine maxim-productengine commented Mar 25, 2024

The script can be signed for 'keystroke' event now.
Added the command for appending text line (text editor) from the script.
Script updates:
Removed util.contains which is the same as table.find in luau;
call leap.request() from LUA main thread.

@@ -74,5 +64,3 @@ function process_events(waitfor)
end

coro.launch(process_events, catch_events)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Use fiber.launch() now, and pass a name. LuaState::expr() now detects if a script has imported fiber.lua, directly or indirectly, and if so it follows up with an implicit fiber.run() call that runs launched coroutines to completion. But fiber.run() only knows about coroutines launched with fiber.launch().

@@ -71,4 +61,3 @@ function process_events(waitfor)
end

coro.launch(process_events, catch_events)
Copy link
Collaborator

Choose a reason for hiding this comment

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

same comment about fiber.launch()

@@ -2,6 +2,7 @@ XML_FILE_PATH = "luafloater_demo.xml"

leap = require 'leap'
coro = require 'coro'
Copy link
Collaborator

Choose a reason for hiding this comment

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

At this point you could ditch require 'coro' too.

@@ -2,6 +2,7 @@ XML_FILE_PATH = "luafloater_gesture_list.xml"

leap = require 'leap'
coro = require 'coro'
Copy link
Collaborator

Choose a reason for hiding this comment

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

require 'coro' no longer needed.

@maxim-productengine maxim-productengine merged commit 55c3276 into release/luau-scripting Mar 26, 2024
6 checks passed
@maxim-productengine maxim-productengine deleted the lua-keystroke branch March 26, 2024 20:30
@github-actions github-actions bot locked and limited conversation to collaborators Mar 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants