But how do i do that with a '*' key rather than an external button?
You want the value of ds to increment by 1 each time you press the '*' key?
It looks like it is doing that now. Though, to be honest, the extra braces and poor indenting are making it hard to tell.
{
ds+=1;
}
No braces needed.
Use Tools + Auto Format to fix the indenting.
Also, adjusting the value of ds and using ds are completely unrelated activities. Putting the code to use ds inside the block that detects a keypress and decides that it is a '*' is wrong.