Now that you've got the basic functionality to draw and manipulate windows, you can design your own control elements such as buttons, edit boxes, and many other.
This recipe will show you how to create buttons and edit boxes that users can interact with. There will be three subsections where each one will deal with one king of control element.
This recipe will use the concepts of the previous window element to create window controls. You should be able to create and draw a window and handle input events. You'll be using mouse and keyboard events primarily.
First, you should extend the applicable event types with keyboard operations. You can do this by adding two event handlers, as shown in the following code:
events[SDL.SDL_KEYDOWN] = function(_event) local event = _event.key local key = event.keysym.sym local mod = event.keysym.mod if gui.focusedWindow then gui.focusedWindow.callSignal(SDL.SDL_KEYDOWN, key, mod) end end events[SDL.SDL_KEYUP...