BBS: Inland Empire Archive Date: 03-03-92 (20:21) Number: 135 From: LYN BORCHERT Refer#: NONE To: MARGARET ROMAO Recvd: NO Subj: Inkey$ routines... Conf: (11) Modula-2
> RV>The problem with this is that the UP ARROW and the "H" key > RV>BOTH produce 72, and the DOWN ARROW and the "P" keys BOTH > RV>produce 80. I had a case where I wanted ARROW input (to go > RV>up and down the menu) *AND* letter input... > OK, OK, several of you called me on this one. I went and tried > it out on one of my scrolling menu routines, and sure enough, > shift + h and shift + p make the little bar go up and down. > I would like to thank all of you who pointed this out to me, > you have saved me a lot of trouble and typing. Here's a little something that returns a unique integer for any key pressed. EXAMPLE OF USE: k% = Code% DECLARE FUNCTION Code% () FUNCTION Code% STATIC DO k$ = INKEY$ LOOP UNTIL LEN(k$) Code% = CVI(k$ + CHR$(0)) END FUNCTION -={ Lyn }=- --- * Origin: The Hour Glass (602)326-2999 {Dual} Home of BasicNet (1:300/12)
Books at Amazon:
Back to BASIC: The History, Corruption, and Future of the Language
Hackers: Heroes of the Computer Revolution (including Tiny BASIC)
Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution
The Advent of the Algorithm: The Idea that Rules the World
Moths in the Machine: The Power and Perils of Programming
Mastering Visual Basic .NET