Reformat raw-mouse code to ZealC code style.

This commit is contained in:
GutPuncher 2023-03-13 22:13:43 -04:00
parent f297f2c265
commit 4109962d84
No known key found for this signature in database
GPG key ID: 38CE0A7B6841D1C7

View file

@ -59,8 +59,10 @@ public U0 MouseRawReset()
public Bool MouseRaw(Bool val)
{ // Places mouse in "raw" mode, button presses will not go to windows manager when true
Bool old_val = mouse_hard.raw_mode;
mouse_hard.raw_mode = val;
mouse.show = !val;
return old_val;
}
@ -277,8 +279,10 @@ U0 MouseHardHandler()
{
I64 i, dx, dy, dz;
U8 mouse_buf[4];
if (!mouse_hard.raw_mode)
MouseHardSetPre;
for (i = 0; i < 4; i++)
mouse_buf[i] = 0;
for (i = 0; i < mouse_hard.pkt_size; i++)
@ -298,7 +302,8 @@ U0 MouseHardHandler()
else
dz = mouse_buf[3] & 7;
if (mouse_hard.raw_mode) {
if (mouse_hard.raw_mode)
{
// buttons / position data need to by consumed by app
// buttons stay down, positions keep accumulating until
// consumed by app and reset with MouseRawReset
@ -311,7 +316,8 @@ U0 MouseHardHandler()
mouse_hard.raw_data.y += dy;
mouse_hard.raw_data.z += dz;
}
else {
else
{
mouse_hard.bttns[0] = mouse_buf[0] & 1;
mouse_hard.bttns[1] = (mouse_buf[0] & 2) >> 1;
mouse_hard.bttns[2] = (mouse_buf[0] & 4) >> 2;