-
Notifications
You must be signed in to change notification settings - Fork 0
CharacterAdder
VetheonGames edited this page Jun 8, 2023
·
1 revision
The CharacterAdder
class is responsible for adding characters to the input string in the DynamicCursesInput gem. It provides a method to add a character at the current cursor position.
This is a class method that adds a character at the current cursor position. It takes three parameters:
-
chk
: the character to be added. -
input
: the current input string. -
cursor_pos
: the current cursor position.
The method inserts the character at the cursor position and increases the cursor position by 1. This simulates the effect of typing a character at the cursor's position in a text editor.
The method returns an array containing two elements: the updated input string and the updated cursor position.