Skip to content

Instantly share code, notes, and snippets.

@petabyt
Created January 21, 2023 02:17
Show Gist options
  • Save petabyt/19e4b8282b8fb6b6ae4c9d4dc67784b6 to your computer and use it in GitHub Desktop.
Save petabyt/19e4b8282b8fb6b6ae4c9d4dc67784b6 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include <fujifilm.h>
#include <rst.h>
#include <fujihack.h>
#include <sqlite.h>
#include <screen.h>
#include <hijack.h>
int buf[10];
int last_input = 0;
int last_key_status = -1;
void func() {
struct FujiInputMap *f = (struct FujiInputMap *)MEM_INPUT_MAP;
if (last_input == 0x816 && f->key_code == 1 && f->key_status == 0 && last_key_status == 0) {
fuji_press_key(8, 0);
last_input = 0;
last_key_status = -1;
}
if (f->key_status == 0 && f->key_code != 0x82e) {
last_input = f->key_code;
last_key_status = 0;
}
}
void entry() {
PATCH8(0x011006b8, 'Z')
fuji_wait_task_start(100, 1, &func, buf);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment