function setStartKey(val)
startKey = val
end
function getStartKey()
return startKey
end
function setStopKey(val)
stopKey = val
end
function getStopKey()
return stopKey
end
No, I know it's a global and you can just modify the variable.
However, if your newish to programming, the only way you'll know how to change it is by looking at the implementation of "lib.lua" and finding the variable name. Actually it would be a pretty good idea to make the start/stop variables local, and not global at all so the programmer doesn't accidentilly overwrite it's value.
A better design would be to make it local, and have mutator/accessor functions so it's encapsulated. And if you have the functions listed in the manual it would make it easier to access/change without having to look through the library code.
You sometimes underestimate my knowledge in programming.
I guess it couldn't really hurt any. Other than breaking compatibility, anyways, but that's been done countless times before for the better. I'll have to take a close look at how Lua handles local variables that are not inside any functions or other containers to make sure it won't cause any problems. lib.lua needs to be rewritten, anyways.
I don't think you'd be able to encapsulate it using Lua as all registered variable outside of local are registered as globals.
I guess you would have to hard code it and make the variables private in C++.
And one more thing, is it possible it's made to work with one key to start/stop. Just like a toggle on/off button would. I tried to do it just by setting startKey and stopKey the same values but it didn't work.