Unable to get my Application to detect the Delete button

為{幸葍}努か 提交于 2020-12-15 07:26:09

问题


I apologize in advance for this vague question but can anyone give me a pointer to this problem?

The Delete key does not work as normal in my application. e.g. The Delete key has no effect in an editbox (i.e. it will not delete highlighted text) but Shift Delete does work. This seems to be the case thoughout the application. I have disabled all keypreviews and OnKey events in case they were causing it but the problem persists.

Can anyone suggest where I might look for the problem?

Running Windows 10 Delphi 10.3.3


回答1:


If this happens only in this particular application, it is likely that you have a TActionList or TActionManager with an action using Delete as its shortcut, or a simple menu item with such a shortcut.

For instance, you might have an Edit menu with a Clear item using Delete as its shortcut:

Then that action or menu item will respond to Delete, not allowing the focused control to do its own thing.

This kind of mistake is surprisingly common. For instance, in the Delphi IDE, you have an edit field above the editor, showing you the current class:

If you select this text and press Ctrl+C, you expect it to end up in the clipboard. But no! Instead, the selected text in the code editor (if any) is copied, even though the code editor didn't have keyboard focus.



来源:https://stackoverflow.com/questions/59929662/unable-to-get-my-application-to-detect-the-delete-button

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!