FreeRDP/server/proxy/modules/demo/demo.c

58 lines
1.5 KiB
C
Raw Normal View History

/**
* FreeRDP: A Remote Desktop Protocol Implementation
* FreeRDP Proxy Server
*
* Copyright 2019 Kobi Mizrachi <kmizrachi18@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <stdio.h>
2019-08-19 16:05:59 +03:00
#include "modules_api.h"
2019-08-19 16:05:59 +03:00
static BOOL demo_filter_keyboard_event(moduleOperations* module, rdpContext* context, void* param)
{
proxyKeyboardEventInfo* event_data = (proxyKeyboardEventInfo*) param;
WINPR_UNUSED(event_data);
2019-08-19 16:05:59 +03:00
return TRUE;
}
2019-08-19 16:05:59 +03:00
static BOOL demo_filter_mouse_event(moduleOperations* module, rdpContext* context, void* param)
{
2019-05-27 12:06:59 +03:00
proxyMouseEventInfo* event_data = (proxyMouseEventInfo*) param;
2019-05-26 15:33:28 +03:00
if (event_data->x % 100 == 0)
{
printf("filter_demo: mouse x is currently %"PRIu16"\n", event_data->x);
2019-05-26 15:33:28 +03:00
}
2019-08-19 16:05:59 +03:00
return TRUE;
}
BOOL module_init(moduleOperations* module)
{
module->KeyboardEvent = demo_filter_keyboard_event;
module->MouseEvent = demo_filter_mouse_event;
return TRUE;
}
2019-08-19 16:05:59 +03:00
BOOL module_exit(moduleOperations* module)
{
2019-08-19 16:05:59 +03:00
printf("bye bye\n");
return TRUE;
}