Is there any way to make it to where when i click a key on the keyboard, something moves on the graph? ie i click “w’“ on my keyboard and a point moves up on the y axis by one
Well, not really, because Desmos does not have the string type for variables …
You can do some ugly tricks like this:
open this graph and type a sequence of “wasd” characters as the value for I = …
https://www.desmos.com/calculator/m0xocrh80i
It only works until the value of I becomes too large.
If you want this trick to work when pressing a lot of keys
you probably need to run a ticker that once in a while resets the value of I
Very clever! Not sure that would work well with the ticker, though, since actions will always set variables to a value rather than a variable name. Regardless, you’d have to click back into the expression line to continue typing. I’m assuming this key-binding is intended to make a game, which would further make it an un-fun solution.
Yes, you are right … the solution with the ticker doesn’t work …
and the idea is clever but also … ugly. Maybe it can be used in other situations
but the ugly fact is that it requires the user to click on the expression and start editing it.
ps: I simplified the code to calculate the number of times that each key has been pressed
As a different solution you can have four buttons on the screen that you can click with the mouse …
Yea, I already did something like that for a game when I figured it out myself. It was pretty cool when I tried it
It’s not the best. However now you can move the viewport with a variable !!!