Wed, 18 Jun 1902 08:00:00 GMT
Alt+anykey help...heres an example and ideas?
Hello! A few days ago I asked about how to make Alt+anykey do something specific I want. Here is an example of what I want it to do. I've messed around with the code, but I can't get it to work when I try and input it into the program I want it in! If someone could look at it and tell me what code I actually need, or show me the sytax of another way I can do it, it would be greatly appreciated: I don't want it to repeat or anything. Just so that if someone presses Alt+F1 or Alt+Fwhatever it will perform something specific. Heres the sample example I found. What code do I need to put into my program I want it in? Uses Crt; var ch: char; begin TextMode (co80); TextColor (15); TextBackGround (1); ClrScr; WriteLn ('Press ESC to quit!'); Repeat ch := ReadKey; If ch = #0 Then Begin Ch := readKey; If ch = #104 Then WriteLn ('Alt+F1'); If ch = #105 Then WriteLn ('Alt+F2'); If ch = #106 Then WriteLn ('Alt+F3'); If ch = #107 Then WriteLn ('Alt+F4'); If ch = #108 Then WriteLn ('Alt+F5'); If ch = #109 Then WriteLn ('Alt+F6'); If ch = #110 Then WriteLn ('Alt+F7'); If ch = #111 Then WriteLn ('Alt+F8'); If ch = #112 Then WriteLn ('Alt+F9'); If ch = #113 Then WriteLn ('Alt+F10'); ch := #0; End; If (ch <>#0) and (ch <> #8) and (ch <> #13) and (ch <> #32) Then WriteLn (ch); Until ch = #27; {Esc pressed?} WriteLn ('Esc'); end. Thanks!!! :) Evan Anderson
|