Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add wrapper for global GUI keyboard support. #1253

Merged
merged 7 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added lib/libkbinput.so
Binary file not shown.
15 changes: 15 additions & 0 deletions src/common/components/kbinput_wrapper.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// kbinput_wrapper.h
#ifndef KBINPUT_WRAPPER_H
#define KBINPUT_WRAPPER_H

#ifdef __cplusplus
extern "C" {
#endif

const char *launch_keyboard(const char *initial_value, const char *title);

#ifdef __cplusplus
}
#endif

#endif // KBINPUT_WRAPPER_H
2 changes: 1 addition & 1 deletion src/tweaks/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ include ../common/config.mk

TARGET = tweaks
CFLAGS := $(CFLAGS) -D_DEFAULT_SOURCE
LDFLAGS := $(LDFLAGS) -lSDL -lSDL_ttf -lSDL_image -lSDL_mixer -lSDL_rotozoom -pthread
LDFLAGS := $(LDFLAGS) -lSDL -lSDL_ttf -lSDL_image -lSDL_mixer -lSDL_rotozoom -pthread -lkbinput

include ../common/commands.mk
include ../common/recipes.mk
7 changes: 7 additions & 0 deletions src/tweaks/actions.h
Original file line number Diff line number Diff line change
Expand Up @@ -408,4 +408,11 @@ void action_advancedSetLcdVoltage(void *pt)
file_put(fp, LCD_VOLT_CONFIG, "%x", 0x0e);
}

const char *action_LaunchKeyboardWrapper(const char *initial_value, const char *title)
{
const char *result = launch_keyboard(initial_value, title);
all_changed = true;
return result;
}

#endif // TWEAKS_ACTIONS_H__
1 change: 1 addition & 0 deletions src/tweaks/menus.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <time.h>
#include <unistd.h>

#include "components/kbinput_wrapper.h"
#include "components/list.h"
#include "system/device_model.h"
#include "system/display.h"
Expand Down
1 change: 1 addition & 0 deletions src/tweaks/tweaks.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ int main(int argc, char *argv[])
if (list_currentItem(menu_stack[menu_level])->action != NULL) {
sound_change();
skip_next_change = true;
keystate[SW_BTN_A] = RELEASED;
}
key_changed = list_activateItem(menu_stack[menu_level]) || header_changed;
}
Expand Down
Loading