summaryrefslogtreecommitdiff
path: root/platform/linuxbsd
diff options
context:
space:
mode:
Diffstat (limited to 'platform/linuxbsd')
-rw-r--r--platform/linuxbsd/export/export_plugin.cpp20
-rw-r--r--platform/linuxbsd/export/export_plugin.h2
-rw-r--r--platform/linuxbsd/key_mapping_x11.cpp42
3 files changed, 59 insertions, 5 deletions
diff --git a/platform/linuxbsd/export/export_plugin.cpp b/platform/linuxbsd/export/export_plugin.cpp
index 9f7fab6ee8..4e14920e79 100644
--- a/platform/linuxbsd/export/export_plugin.cpp
+++ b/platform/linuxbsd/export/export_plugin.cpp
@@ -35,7 +35,10 @@
Error EditorExportPlatformLinuxBSD::_export_debug_script(const Ref<EditorExportPreset> &p_preset, const String &p_app_name, const String &p_pkg_name, const String &p_path) {
Ref<FileAccess> f = FileAccess::open(p_path, FileAccess::WRITE);
- ERR_FAIL_COND_V(f.is_null(), ERR_CANT_CREATE);
+ if (f.is_null()) {
+ add_message(EXPORT_MESSAGE_ERROR, TTR("Debug Script Export"), vformat(TTR("Could not open file \"%s\"."), p_path));
+ return ERR_CANT_CREATE;
+ }
f->store_line("#!/bin/sh");
f->store_line("echo -ne '\\033c\\033]0;" + p_app_name + "\\a'");
@@ -67,6 +70,9 @@ Error EditorExportPlatformLinuxBSD::export_project(const Ref<EditorExportPreset>
String scr_path = p_path.get_basename() + ".sh";
err = _export_debug_script(p_preset, app_name, p_path.get_file(), scr_path);
FileAccess::set_unix_permissions(scr_path, 0755);
+ if (err != OK) {
+ add_message(EXPORT_MESSAGE_ERROR, TTR("Debug Script Export"), TTR("Could not create console script."));
+ }
}
}
@@ -98,11 +104,12 @@ List<String> EditorExportPlatformLinuxBSD::get_binary_extensions(const Ref<Edito
return list;
}
-Error EditorExportPlatformLinuxBSD::fixup_embedded_pck(const String &p_path, int64_t p_embedded_start, int64_t p_embedded_size) const {
+Error EditorExportPlatformLinuxBSD::fixup_embedded_pck(const String &p_path, int64_t p_embedded_start, int64_t p_embedded_size) {
// Patch the header of the "pck" section in the ELF file so that it corresponds to the embedded data
Ref<FileAccess> f = FileAccess::open(p_path, FileAccess::READ_WRITE);
if (f.is_null()) {
+ add_message(EXPORT_MESSAGE_ERROR, TTR("PCK Embedding"), vformat(TTR("Failed to open executable file \"%s\"."), p_path));
return ERR_CANT_OPEN;
}
@@ -110,6 +117,7 @@ Error EditorExportPlatformLinuxBSD::fixup_embedded_pck(const String &p_path, int
{
uint32_t magic = f->get_32();
if (magic != 0x464c457f) { // 0x7F + "ELF"
+ add_message(EXPORT_MESSAGE_ERROR, TTR("PCK Embedding"), TTR("Executable file header corrupted."));
return ERR_FILE_CORRUPT;
}
}
@@ -119,7 +127,7 @@ Error EditorExportPlatformLinuxBSD::fixup_embedded_pck(const String &p_path, int
int bits = f->get_8() * 32;
if (bits == 32 && p_embedded_size >= 0x100000000) {
- ERR_FAIL_V_MSG(ERR_INVALID_DATA, "32-bit executables cannot have embedded data >= 4 GiB.");
+ add_message(EXPORT_MESSAGE_ERROR, TTR("PCK Embedding"), TTR("32-bit executables cannot have embedded data >= 4 GiB."));
}
// Get info about the section header table
@@ -196,5 +204,9 @@ Error EditorExportPlatformLinuxBSD::fixup_embedded_pck(const String &p_path, int
memfree(strings);
- return found ? OK : ERR_FILE_CORRUPT;
+ if (!found) {
+ add_message(EXPORT_MESSAGE_ERROR, TTR("PCK Embedding"), TTR("Executable \"pck\" section not found."));
+ return ERR_FILE_CORRUPT;
+ }
+ return OK;
}
diff --git a/platform/linuxbsd/export/export_plugin.h b/platform/linuxbsd/export/export_plugin.h
index 9ae5cf827a..e04bcc20f9 100644
--- a/platform/linuxbsd/export/export_plugin.h
+++ b/platform/linuxbsd/export/export_plugin.h
@@ -46,7 +46,7 @@ public:
virtual List<String> get_binary_extensions(const Ref<EditorExportPreset> &p_preset) const override;
virtual Error export_project(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags = 0) override;
virtual String get_template_file_name(const String &p_target, const String &p_arch) const override;
- virtual Error fixup_embedded_pck(const String &p_path, int64_t p_embedded_start, int64_t p_embedded_size) const override;
+ virtual Error fixup_embedded_pck(const String &p_path, int64_t p_embedded_start, int64_t p_embedded_size) override;
};
#endif
diff --git a/platform/linuxbsd/key_mapping_x11.cpp b/platform/linuxbsd/key_mapping_x11.cpp
index afe965e038..047ee74671 100644
--- a/platform/linuxbsd/key_mapping_x11.cpp
+++ b/platform/linuxbsd/key_mapping_x11.cpp
@@ -135,6 +135,25 @@ static _XTranslatePair _xkeysym_to_keycode[] = {
{ XK_F14, Key::F14 },
{ XK_F15, Key::F15 },
{ XK_F16, Key::F16 },
+ { XK_F17, Key::F17 },
+ { XK_F18, Key::F18 },
+ { XK_F19, Key::F19 },
+ { XK_F20, Key::F20 },
+ { XK_F21, Key::F21 },
+ { XK_F22, Key::F22 },
+ { XK_F23, Key::F23 },
+ { XK_F24, Key::F24 },
+ { XK_F25, Key::F25 },
+ { XK_F26, Key::F26 },
+ { XK_F27, Key::F27 },
+ { XK_F28, Key::F28 },
+ { XK_F29, Key::F29 },
+ { XK_F30, Key::F30 },
+ { XK_F31, Key::F31 },
+ { XK_F32, Key::F32 },
+ { XK_F33, Key::F33 },
+ { XK_F34, Key::F34 },
+ { XK_F35, Key::F35 },
// media keys
{ XF86XK_Back, Key::BACK },
@@ -294,6 +313,29 @@ static _TranslatePair _scancode_to_keycode[] = {
{ Key::SUPER_L, 0x85 },
{ Key::SUPER_R, 0x86 },
{ Key::MENU, 0x87 },
+ { Key::F13, 0xBF },
+ { Key::F14, 0xC0 },
+ { Key::F15, 0xC1 },
+ { Key::F16, 0xC2 },
+ { Key::F17, 0xC3 },
+ { Key::F18, 0xC4 },
+ { Key::F19, 0xC5 },
+ { Key::F20, 0xC6 },
+ { Key::F21, 0xC7 },
+ { Key::F22, 0xC8 },
+ { Key::F23, 0xC9 },
+ { Key::F24, 0xCA },
+ { Key::F25, 0xCB },
+ { Key::F26, 0xCC },
+ { Key::F27, 0xCD },
+ { Key::F28, 0xCE },
+ { Key::F29, 0xCF },
+ { Key::F30, 0xD0 },
+ { Key::F31, 0xD1 },
+ { Key::F32, 0xD2 },
+ { Key::F33, 0xD3 },
+ { Key::F34, 0xD4 },
+ { Key::F35, 0xD5 },
{ Key::UNKNOWN, 0 }
};