#ifndef MS_PACKET_KEY_DOWN #define MS_PACKET_KEY_DOWN #include #include #include #include #include #include #include struct msPacket; /** * The packet kind received when a key is pressed that should be handled by the emulator. */ struct msPacketKeyDown { //! Determines if the key is pressed or un pressed. char isPressed; //! The key pressed. int key; }; /** * Destroys the msPacketKeyDown * @param keyDown The pointer to the pointer to keyDown to null it after this operation. */ void msPacketKeyDownDestroy(struct msPacketKeyDown **keyDown); /** * Handles the msPacketKeyDown * @param packet The packet containing msPacketKeyDown, should have PACKET_GET_KEY_DOWN as its id. * @param keyDown This object. * @param data The session data. */ bool msPacketKeyDownHandle(const struct msPacket *packet, struct msPacketKeyDown *keyDown, struct msClientConnectionData *const data); /** * Retrieves the msPacketKeyDown contained in the packet raw_data. * @param packet The packet containing msPacketKeyDown, should have PACKET_GET_KEY_DOWN as its id. * @param client_fd The source of this packet. * @param data The session data. */ bool msPacketKeyDownGet(const struct msPacket *packet, int client_fd, struct msClientConnectionData *const data); #endif