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

hiro: fix double character inputs in Windows HexEdit widget #1798

Merged
merged 1 commit into from
Jan 28, 2025
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
8 changes: 5 additions & 3 deletions hiro/windows/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,11 @@ static auto Application_keyboardProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM
//TODO: does this really need to be hooked here?
#if defined(Hiro_Widget)
if(auto widget = dynamic_cast<mWidget*>(object)) {
if(auto self = widget->self()) {
if(auto result = self->windowProc(self->hwnd, msg, wparam, lparam)) {
return result();
if(!dynamic_cast<mHexEdit*>(object)) {
if(auto self = widget->self()) {
if(auto result = self->windowProc(self->hwnd, msg, wparam, lparam)) {
return result();
}
}
}
}
Expand Down
1 change: 1 addition & 0 deletions hiro/windows/widget/hex-edit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ auto pHexEdit::keyPress(u32 scancode) -> bool {
}

//convert scancode to hex nibble
scancode = pKeyboard::_translate(scancode, 0);
if(scancode >= '0' && scancode <= '9') scancode = scancode - '0';
else if(scancode >= 'A' && scancode <= 'F') scancode = scancode - 'A' + 10;
else if(scancode >= 'a' && scancode <= 'f') scancode = scancode - 'a' + 10;
Expand Down
Loading