|
|
@ -6,18 +6,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
boolean key_was_pressed (byte keyState)
|
|
|
|
boolean key_was_pressed (byte keyState)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if ( byte((keyState >> 7)) ^ B00000001 ) {
|
|
|
|
return (! key_was_not_pressed(keyState));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
boolean key_was_not_pressed (byte keyState)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if ( keyState & B00001000 || keyState & B00000100) {
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
boolean key_was_not_pressed (byte keyState)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return !key_was_pressed(keyState);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -25,16 +31,16 @@ boolean key_was_not_pressed (byte keyState)
|
|
|
|
boolean key_is_pressed (byte keyState)
|
|
|
|
boolean key_is_pressed (byte keyState)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
if ( byte((keyState << 7)) ^ B10000000 ) {
|
|
|
|
if ( keyState & B00000001 && keyState & B00000010 ){
|
|
|
|
return false;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
boolean key_is_not_pressed (byte keyState)
|
|
|
|
boolean key_is_not_pressed (byte keyState)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return(!key_is_pressed(keyState));
|
|
|
|
return !key_is_pressed(keyState);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
boolean key_toggled_on(byte keyState)
|
|
|
|
boolean key_toggled_on(byte keyState)
|
|
|
|