Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Backspace
- dj_greener
-
Scratcher
500+ posts
Backspace
I made a interactive keyboard but i want to know how to make backspace.
https://scratch.mit.edu/projects/832837849/
https://scratch.mit.edu/projects/832837849/
- medians
-
Scratcher
1000+ posts
Backspace
Just remove the last letter from what is being typed (haven't tested this):
set [original text v] to (text)Do you have any questions about this code?
set [text v] to []
repeat ((length of (original text)) - (1)
set [text v] to (join (text) (letter ((length of (text)) + (1)) of (original text)))
end
- Knightbot63
-
Scratcher
1000+ posts
Backspace
(#2)Backspace is not the same as delete, delete deletes the text after the cursor while backspace moves the cursor back to delete it. Depending on your OS
By backspace do you mean the delete button?
~~~~~
The text could go into the list, then when someone hits the backspace key, you can delete the most recent key that's on the list using
delete (last v) of [list v]
or
delete (length of [list v]) of [list v]
- _Cheez_
-
Scratcher
22 posts
Backspace
I made a interactive keyboard but i want to know how to make backspace.Oh, I see what you mean about your project, and I'll try to figure it out.
https://scratch.mit.edu/projects/832837849/
- sushi_cat_110
-
Scratcher
71 posts
Backspace
I made a interactive keyboard but i want to know how to make backspace.Put this is the stage.
https://scratch.mit.edu/projects/832837849/
when green flag clickedMake a list and put this in each of the letter sprites.
set [whatever you want to name it v] to [1]
when this sprite clickedAnd in the backspace key sprite, do this.
Your code here.
add [whatever letter you pressed] to [the list v]
when green flag clickedI don't know how to make it display though sorry, but that's how to make a backspace I think.
go to x: (whatever) y: (whatever)
when this sprite clicked
delete (the variable mentioned above) of [list v]
change [the variable v] by (-1)
Last edited by sushi_cat_110 (April 13, 2023 15:40:42)
- sushi_cat_110
-
Scratcher
71 posts
Backspace
The one they're doing is a windows keyboard, seeing as there is a window button.(#2)Backspace is not the same as delete, delete deletes the text after the cursor while backspace moves the cursor back to delete it. Depending on your OS
By backspace do you mean the delete button?
~~~~~
The text could go into the list, then when someone hits the backspace key, you can delete the most recent key that's on the list usingdelete (last v) of [list v]
or
delete (length of [list v]) of [list v]
- coIIide
-
Scratcher
100+ posts
Backspace
I made a interactive keyboard but i want to know how to make backspace.Here you go
https://scratch.mit.edu/projects/832837849/
when this sprite clicked // In all the key blocks
add [the letter] to [Letters/Words v]
when this sprite clicked // in backspace
delete (length of [list v] :: list) of [list v]
when gf clicked
forever
set [Letters/words v] to (Letters/Words :: list) // you can find this input under variables
- Knightbot63
-
Scratcher
1000+ posts
Backspace
(#7)That's why I had mentioned that backspace and delete may be different depending on the OS.
The one they're doing is a windows keyboard, seeing as there is a window button.
- dj_greener
-
Scratcher
500+ posts
Backspace
Just remove the last letter from what is being typed (haven't tested this):It did not work.set [original text v] to (text)Do you have any questions about this code?
set [text v] to []
repeat ((length of (original text)) - (1)
set [text v] to (join (text) (letter ((length of (text)) + (1)) of (original text)))
end
- dj_greener
-
Scratcher
500+ posts
Backspace
By backspace do you mean the delete button?No, the delete button is just a placeholder.
- medians
-
Scratcher
1000+ posts
Backspace
It seems to work fine for me, how are you using it, and does it look exactly like this?Just remove the last letter from what is being typed (haven't tested this):It did not work.set [original text v] to (text)Do you have any questions about this code?
set [text v] to []
repeat ((length of (original text)) - (1)
set [text v] to (join (text) (letter ((length of (text)) + (1)) of (original text)))
end

Also, I'm now confused on what you're wanting this to do if that's the case.
- misha_kelly290414
-
Scratcher
2 posts
Backspace
Hi can someone help me with
<key [ delete] pressed?>is it possible if yes say me on my account.
- misha_kelly290414
-
Scratcher
2 posts
Backspace
Hi can someone help me with<key [ delete] pressed?>is it possible if yes say me on my account.
- Discussion Forums
- » Help with Scripts
-
» Backspace