-
Notifications
You must be signed in to change notification settings - Fork 13
Small change #446
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
Small change #446
Changes from all commits
50fb4d6
56a5a73
72e5c4c
e46573c
bd5b294
8509f49
cb28665
fbe29ae
60c5e6f
f630a15
97c7e43
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -94,6 +94,8 @@ FunHook<int(int16_t)> key_to_ascii_hook{ | |
| if (key & rf::KEY_CTRLED) { | ||
| key_state[VK_CONTROL] = 0x80; | ||
| } | ||
| // HACKFIX. Must be set for `ToUnicode` to produce capitalized letters. | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this actually a hackfix? Seems no? Isn't this the proper way to do this?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is a hackfix due to subtle timing issues. The key has been captured at an earlier time. But it is good enough imo. |
||
| key_state[VK_CAPITAL] = GetKeyState(VK_CAPITAL) & 1; | ||
| int scan_code = key & 0x7F; | ||
| auto vk = MapVirtualKeyA(scan_code, MAPVK_VSC_TO_VK); | ||
| WCHAR unicode_chars[3]; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -65,6 +65,16 @@ namespace rf::console | |
| output(s.c_str(), nullptr); | ||
| } | ||
|
|
||
| template <typename... Args> | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this intended for future use? doesnt seem to be used currently?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it might be useful or I may use it later in a PR. I already do use it internally. |
||
| inline void print( | ||
| const rf::gr::Color& color, | ||
| const std::format_string<Args...> fmt, | ||
| Args&&... args | ||
| ) { | ||
| const std::string s = std::format(fmt, std::forward<Args>(args)...); | ||
| output(s.c_str(), &color); | ||
| } | ||
|
|
||
| //static auto& commands = addr_as_ref<ConsoleCommand*[30]>(0x01775530); | ||
| static auto& num_commands = addr_as_ref<int>(0x0177567C); | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It allows code in sub-directories so it is useful. I have used it before but I do not use it at the moment. It is easier for me to have it upstream.