Discuss Scratch

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/
_Cheez_
Scratcher
22 posts

Backspace

By backspace do you mean the delete button?
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)
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
Do you have any questions about this code?
Knightbot63
Scratcher
1000+ posts

Backspace

_Cheez_ wrote:

(#2)
By backspace do you mean the delete button?
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
~~~~~
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

dj_greener wrote:

I made a interactive keyboard but i want to know how to make backspace.
https://scratch.mit.edu/projects/832837849/
Oh, I see what you mean about your project, and I'll try to figure it out.
sushi_cat_110
Scratcher
71 posts

Backspace

dj_greener wrote:

I made a interactive keyboard but i want to know how to make backspace.
https://scratch.mit.edu/projects/832837849/
Put this is the stage.
when green flag clicked
set [whatever you want to name it v] to [1]
Make a list and put this in each of the letter sprites.
when this sprite clicked
Your code here.
add [whatever letter you pressed] to [the list v]
And in the backspace key sprite, do this.
when green flag clicked
go to x: (whatever) y: (whatever)
when this sprite clicked
delete (the variable mentioned above) of [list v]
change [the variable v] by (-1)
I don't know how to make it display though sorry, but that's how to make a backspace I think.

Last edited by sushi_cat_110 (April 13, 2023 15:40:42)

sushi_cat_110
Scratcher
71 posts

Backspace

Knightbot63 wrote:

_Cheez_ wrote:

(#2)
By backspace do you mean the delete button?
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
~~~~~
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]
The one they're doing is a windows keyboard, seeing as there is a window button.
coIIide
Scratcher
100+ posts

Backspace

dj_greener wrote:

I made a interactive keyboard but i want to know how to make backspace.
https://scratch.mit.edu/projects/832837849/
Here you go
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

sushi_cat_110 wrote:

(#7)
The one they're doing is a windows keyboard, seeing as there is a window button.
That's why I had mentioned that backspace and delete may be different depending on the OS.
dj_greener
Scratcher
500+ posts

Backspace

medians wrote:

Just remove the last letter from what is being typed (haven't tested this):
set [original text v] to (text)
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
Do you have any questions about this code?
It did not work.
dj_greener
Scratcher
500+ posts

Backspace

_Cheez_ wrote:

By backspace do you mean the delete button?
No, the delete button is just a placeholder.
medians
Scratcher
1000+ posts

Backspace

dj_greener wrote:

medians wrote:

Just remove the last letter from what is being typed (haven't tested this):
set [original text v] to (text)
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
Do you have any questions about this code?
It did not work.
It seems to work fine for me, how are you using it, and does it look exactly like this?
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

misha_kelly290414 wrote:

Hi can someone help me with
<key [ delete] pressed?>
is it possible if yes say me on my account.

Powered by DjangoBB