espanso/native/libmacbridge/bridge.h

47 lines
1000 B
C
Raw Normal View History

2019-09-05 15:20:52 +00:00
#ifndef ESPANSO_BRIDGE_H
#define ESPANSO_BRIDGE_H
#include <stdint.h>
2019-09-05 16:34:03 +00:00
extern "C" {
2019-09-05 15:20:52 +00:00
/*
2019-09-05 16:34:03 +00:00
* Initialize the AppDelegate and check for accessibility permissions
*/
int32_t initialize();
2019-09-05 15:20:52 +00:00
/*
* Start the event loop indefinitely. Blocking call.
*/
2019-09-05 16:34:03 +00:00
int32_t eventloop();
/*
* Called when a new keypress is made, the first argument is an char array,
* while the second is the size of the array.
*/
2019-09-05 17:18:55 +00:00
typedef void (*KeypressCallback)(void * self, const char *buffer, int32_t len, int32_t is_modifier, int32_t key_code);
2019-09-05 16:34:03 +00:00
extern KeypressCallback keypress_callback;
extern void * interceptor_instance;
/*
* Register the callback that will be called when a keypress was made
*/
void register_keypress_callback(void *self, KeypressCallback callback);
/*
* Type the given string by using the CGEventKeyboardSetUnicodeString call
*/
void send_string(const char * string);
/*
* Send the backspace keypress, *count* times.
*/
extern "C" void delete_string(int32_t count);
};
2019-09-05 15:20:52 +00:00
#endif //ESPANSO_BRIDGE_H