How do I make a backspace button for a keyboard?

I’m making a keyboard in Creative.


Each letter involves text, and a button, which is connected to a trigger that has the following block (different for each letter):
image
There is a game overlay that updates to the Property Text.

There is also a clear message button which sets the text to ’ '.
image
Is there a way that I can make it backspace a single letter without having to clear the whole message?

3 Likes
  • Bump.

1 Like

I’m not totally sure, but I don’t think there’s a way within the current block coding system.

13 Likes

Yeah, unless you can somehow assign like a variable or number to each letter typed, but I don’t think that’s possible with the code blocks in gimkit.

4 Likes

How do you get Gimkit’s Font?

2 Likes

It’s called Fugaz One

4 Likes

If you set the code up so that the current text to a property, let’s call it TextOneKeyPressAgo, and then the letter gets added onto the current line, you can make a rudimentary backspace key. When the key is pressed, set the text to the TextOneKeyPressAgo property.

4 Likes

Hmmm, this only works with one backspace, which isn’t practical. Expanding this system would take up a lot of memory, I wonder if there’s a better solution?

6 Likes

I was thinking about having each key stored as a property, but the main issue is you can’t unjoin things you already joined

5 Likes

You know, there’s a lot of cool computer science stuff that does some impossible stuff within limits. For example, there is a way to write packets of data in such a way that if the packet is damaged and is corrupted, it can fix itself, even when the anti-corruption is corrupted. What I’m getting at here is that there might be a way to write text as a number, where we could then do math operations on it to remove previously existed text.

5 Likes

Yes, but how would we tell Gimkit to do the correct operations?

3 Likes

Hmm. I have an idea, give me a second to type it.

3 Likes

How do real computers use the backspace key?

3 Likes

Let’s have a number property. This will store our text. Every two digits will represent a letter in number code, ex: 0805121215. Then, when we want to subtract a letter, we just remove it as a number. So for the above example, we would do -15. Then we would do -1200, then -120000, adding two zeros to what we subtract each time. If we want to add a letter, first check for sets of 00s, and add the appropriate number. If we have a number with no 00s at the end, we can multiply by 100 and add the letter we want in number code.

5 Likes

They store a string as a list of 8 bit numbers, and when backspace is pressed, they remove the most recent entry into the list.

The way they write characters in 8 bits is called ASCII, if you want to learn more about it.

4 Likes

Okay, that’s a plan. How would we store the reverse operations?

3 Likes

Also, when I manage to get un-stuck from the airport I’m in and get home, I’m gonna write a tutorial on this, so don’t beat me too it please :smiley:

4 Likes

There’s only one problem, we need to know the most recent character to delete it. We also need the length of the string.

2 Likes

I’m not writing any tutorials this week. Please don’t make a monopoly tutorial, though.

3 Likes

Monopoly? Oh wow, good luck!

3 Likes