Key vs. click

A part of the script of my project is:
if <mouse down?>
-pen down
-pen up
Another part says:
if <key [s] pressed?...
...and it does something else.
When I press the S key, a dot appears on the screen.
In short, when I press a key, the program seems to "think" that the mouse is down. Is this a bug, is it supposed to be that way, or is it just my browser? (Or is it this laptop which acts like it's old but it's only a year old?)

It would help if we could see the code that runs when you press the S key

untitled script pic (2)

Well, then idk. I can't test it right now, or any time this week (I'm on mobile, and I got marching band all week), so I guess someone else could try. Of course, if I could see all the code in the project, I might be able to figure out why it's happening without actually testing it.

Here it is, if you want to see it.
Maybe I should just not worry about it. The
image part is completely unnecessary. I think I'll just delete it, and call it good.

untitled script pic - 2022-07-29T010102.370
After keypress the pen is down.
Next, the untitled script pic - 2022-07-29T010159.526 draws a line.

OK, thanks