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

CTLR + BACKSPACE onKeyPress problem #869

Closed
3 of 5 tasks
leonves opened this issue Sep 11, 2024 · 1 comment
Closed
3 of 5 tasks

CTLR + BACKSPACE onKeyPress problem #869

leonves opened this issue Sep 11, 2024 · 1 comment
Labels
Priority: Medium This issue may be impactful and needs some attention. Status: Pending Test This PR or Issue requires more testing Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors.

Comments

@leonves
Copy link

leonves commented Sep 11, 2024

Priority

Medium

Area

  • Data
  • Source
  • Docker
  • Other

What happened?

When I press CTRL + backspace in any text editor, it glitches. Does anyone know what it could be? I tried changing the function to do nothing when pressed, but it didn’t work.

2.mp4

What OS are you seeing the problem on?

Windows

Code of Conduct

  • I agree to follow this project's Code of Conduct
@leonves leonves added the Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors. label Sep 11, 2024
@github-actions github-actions bot added Priority: Medium This issue may be impactful and needs some attention. Status: Pending Test This PR or Issue requires more testing labels Sep 11, 2024
@gesior
Copy link
Contributor

gesior commented Oct 2, 2024

I've tested this. Pressing CTRL+BACKSPACE adds 7F (127) ASCII character, which in Notepad++ is printed as special character DEL
image

Fix (removes 1 character, not 1 word, but blocks character 127) in src/framework/ui/uitextedit.cpp:

This will make CTRL+BACKSPACE work as BACKSPACE (todo: make it remove whole word)
Under:

        } else if (keyCode == Fw::KeyA && getProp(PropSelectable)) {
            if (m_text.length() > 0) {
                selectAll();
                return true;
            }
        }

Paste:

        else if(keyCode == Fw::KeyBackspace && getProp(PropEditable)) { // erase left word
            if (hasSelection() || !m_text.empty()) {
                // todo: remove word, not 1 character
                del(false);
                return true;
            }
        }

This will block adding character 127 to text edit area:
Under:

bool UITextEdit::onKeyText(const std::string_view keyText)
{

Paste:

    if (keyText.length() == 1 && keyText.front() == 127) {
        return false;
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: Medium This issue may be impactful and needs some attention. Status: Pending Test This PR or Issue requires more testing Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors.
Projects
None yet
Development

No branches or pull requests

3 participants