By default, the cursor's blinking cycle is independent from user actions, which feels unconventional while editing pattern code. This change ensures that the blinking cycle is reset, and the cursor is made visible every time the editor receives a keyboard event like character entry, or arrow navigation.
Implementation description
I moved the hard-coded blink timing numbers to their dedicated static constant fields since now they are referenced from multiple different places.
I added the function void ResetCursorBlinkTime() to TextEditor.cpp that will reset the blink cycle to currentMillis() - sCursorBlinkOnTime, ensuring that the cursor is visible. This function is called for every keyboard and mouse click event.
Problem description
By default, the cursor's blinking cycle is independent from user actions, which feels unconventional while editing pattern code. This change ensures that the blinking cycle is reset, and the cursor is made visible every time the editor receives a keyboard event like character entry, or arrow navigation.
Implementation description
I moved the hard-coded blink timing numbers to their dedicated static constant fields since now they are referenced from multiple different places.
I added the function
void ResetCursorBlinkTime()
toTextEditor.cpp
that will reset the blink cycle tocurrentMillis() - sCursorBlinkOnTime
, ensuring that the cursor is visible. This function is called for every keyboard and mouse click event.Screenshots
Before:
https://github.com/WerWolv/ImHex/assets/45818400/668c6802-79a3-450b-80d3-d6abf2ce27be
After:
https://github.com/WerWolv/ImHex/assets/45818400/ee7f60e0-a75f-416d-b86d-8d12b5cdadf2