1
0
mirror of synced 2025-02-17 18:59:21 +01:00

fix: Keyboard shortcuts didn't work. Added Select all menu item

This commit is contained in:
WerWolv 2021-07-29 21:09:18 +02:00
parent c6bd6d4a3b
commit f4046fb8fc
5 changed files with 8 additions and 2 deletions

View File

@ -207,6 +207,7 @@ namespace hex::plugin::builtin {
{ "hex.view.hexeditor.copy.ascii", "ASCII Art" },
{ "hex.view.hexeditor.copy.html", "HTML" },
{ "hex.view.hexeditor.menu.edit.paste", "Einfügen" },
{ "hex.view.hexeditor.menu.edit.select_all", "Alles auswählen" },
{ "hex.view.hexeditor.menu.edit.bookmark", "Lesezeichen erstellen" },
{ "hex.view.hexeditor.menu.edit.set_base", "Basisadresse setzen" },
{ "hex.view.hexeditor.menu.edit.resize", "Grösse ändern" },

View File

@ -207,6 +207,7 @@ namespace hex::plugin::builtin {
{ "hex.view.hexeditor.copy.ascii", "ASCII Art" },
{ "hex.view.hexeditor.copy.html", "HTML" },
{ "hex.view.hexeditor.menu.edit.paste", "Paste" },
{ "hex.view.hexeditor.menu.edit.select_all", "Select all" },
{ "hex.view.hexeditor.menu.edit.bookmark", "Create bookmark" },
{ "hex.view.hexeditor.menu.edit.set_base", "Set base address" },
{ "hex.view.hexeditor.menu.edit.resize", "Resize" },

View File

@ -207,6 +207,7 @@ namespace hex::plugin::builtin {
{ "hex.view.hexeditor.copy.ascii", "ASCII Art" },
{ "hex.view.hexeditor.copy.html", "HTML" },
{ "hex.view.hexeditor.menu.edit.paste", "Incolla" },
//{ "hex.view.hexeditor.menu.edit.select_all", "Select all" },
{ "hex.view.hexeditor.menu.edit.bookmark", "Crea segnalibro" },
{ "hex.view.hexeditor.menu.edit.set_base", "Imposta indirizzo di base" },
// { "hex.view.hexeditor.menu.edit.resize", "Resize" },

View File

@ -611,7 +611,7 @@ namespace hex {
this->pasteBytes();
return true;
} else if (ctrl && keys['A']) {
EventManager::post<RequestSelectionChange>(Region { SharedData::currentProvider->getBaseAddress(), SharedData::currentProvider->getSize() });
EventManager::post<RequestSelectionChange>(Region { SharedData::currentProvider->getBaseAddress(), SharedData::currentProvider->getActualSize() });
return true;
}
}
@ -1276,6 +1276,9 @@ R"(
if (ImGui::MenuItem("hex.view.hexeditor.menu.edit.paste"_lang, "CTRL + V", false, bytesSelected))
this->pasteBytes();
if (ImGui::MenuItem("hex.view.hexeditor.menu.edit.select_all"_lang, "CTRL + A", false, SharedData::currentProvider != nullptr))
EventManager::post<RequestSelectionChange>(Region { SharedData::currentProvider->getBaseAddress(), SharedData::currentProvider->getActualSize() });
ImGui::Separator();
if (ImGui::MenuItem("hex.view.hexeditor.menu.edit.bookmark"_lang, nullptr, false, this->m_memoryEditor.DataPreviewAddr != -1 && this->m_memoryEditor.DataPreviewAddrEnd != -1)) {

View File

@ -380,9 +380,9 @@ namespace hex {
void Window::frame() {
bool pressedKeys[512] = { false };
std::copy_n(ImGui::GetIO().KeysDown, 512, this->m_prevKeysDown);
for (u16 i = 0; i < 512; i++)
pressedKeys[i] = ImGui::GetIO().KeysDown[i] && !this->m_prevKeysDown[i];
std::copy_n(ImGui::GetIO().KeysDown, 512, this->m_prevKeysDown);
for (const auto &call : View::getDeferedCalls())
call();