Forum > Other

FPGui Keyevent

<< < (2/3) > >>

relocate:
Hi,

thank you for your  suggestions, but that won't work for me.
Backspace was one example. But I would rather need to prevent some keystrokes other than to correct them.
May be I have to think about another way.

relocate

winni:
Hi!

This is a simple way to block some keys.
Here we block F1 and Escape.


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TForm1.Memo1KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState         );begin   if (key =VK_F1) or (Key = VK_ESCAPE) then key := 0;end; 

If this does not work for you, then this is a bug and you should follow the steps shown by Bart.

Winni

relocate:
In FPGui it doesn't work like this.
There is an OnKeyPress property, but if I use this, there are some keys that won't get to the procedure, they are allready processed by the memo itself.
So now I made a new class with fpgmemo as parent and overide the keypress procedure and now I get all keys.
Thank you for your suggestions.

Bart:
Only keys that are printable characters (please don't stat a war about UTF-8) don't make it into OnKeyPress.
This is by design.
Amost all keys should be visible in OnKeyDown however.

Bart

relocate:
Hey,

as I mentioned, it is about, for example, the backspace key. It is far away from UTF-8 things.

relocate

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version