Skip to content

Commit

Permalink
cursor: implement cursor move
Browse files Browse the repository at this point in the history
  • Loading branch information
quantum5 authored and gnif committed Sep 19, 2022
1 parent f022656 commit a2756c7
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/channel_cursor.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,16 @@ static PS_STATUS onMessage_cursorSet(PSChannel * channel)
return PS_STATUS_OK;
}

static PS_STATUS onMessage_cursorMove(PSChannel * channel)
{
SpiceMsgCursorMove * msg = (SpiceMsgCursorMove *)channel->buffer;

g_ps.cursor.x = msg->position.x;
g_ps.cursor.y = msg->position.y;

return PS_STATUS_OK;
}

PSHandlerFn channelCursor_onMessage(PSChannel * channel)
{
channel->initDone = true;
Expand All @@ -200,6 +210,9 @@ PSHandlerFn channelCursor_onMessage(PSChannel * channel)

case SPICE_MSG_CURSOR_SET:
return onMessage_cursorSet;

case SPICE_MSG_CURSOR_MOVE:
return onMessage_cursorMove;
}

return PS_HANDLER_DISCARD;
Expand Down

0 comments on commit a2756c7

Please sign in to comment.