[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/db/driver/mysqli.php on line 264: mysqli_fetch_assoc(): Couldn't fetch mysqli_result
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/db/driver/mysqli.php on line 326: mysqli_free_result(): Couldn't fetch mysqli_result
Pete's QBASIC Site Discuss QBasic, Freebasic, QB64 and more 2008-01-28T06:43:12-05:00 http://petesqbsite.com/phpBB3/app.php/feed/topic/2576 2008-01-28T06:43:12-05:00 2008-01-28T06:43:12-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=16502#p16502 <![CDATA[Fastest way to get Keyboard presses]]> kk thanks burger, everyone else :)

Statistics: Posted by Sinuvoid — Mon Jan 28, 2008 6:43 am


]]>
2008-01-27T20:36:45-05:00 2008-01-27T20:36:45-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=16500#p16500 <![CDATA[Fastest way to get Keyboard presses]]>
The idea to learn INP(&H60) is to find out what keypress creates what code.

You can find many of the keys with 2 byte ASCII codes like CHR$(0) + CHR(asciicode) using INKEY instead. Try the arrow keys.

Ted

Statistics: Posted by burger2227 — Sun Jan 27, 2008 8:36 pm


]]>
2008-01-27T12:46:40-05:00 2008-01-27T12:46:40-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=16497#p16497 <![CDATA[Fastest way to get Keyboard presses]]>
I guess the post got lost somehow, well no worries.

Statistics: Posted by Seb McClouth — Sun Jan 27, 2008 12:46 pm


]]>
2008-01-27T10:24:01-05:00 2008-01-27T10:24:01-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=16496#p16496 <![CDATA[Fastest way to get Keyboard presses]]>
To use backspace, you have to print a blank space (CHR$(32) or " "), and then locate back to that space. That's the most simple way to do it.

Edit: To do something similar to the pssys program above, just make a program with the PInput$ function, and then do the following code.

Code:

DO UNTIL UserAllowed% CLS PRINT "Username:" User$ = PINPUT$(15,1,30,0,"") PRINT "Password:" Pass$ = PINPUT$(15,2,30,ASC("*"),"") IF User$ = "USER1" AND Pass$ = "ENTER" THEN UserAllowed% = 1 IF User$ = "ADMIN" AND Pass$ = "LETMEIN" THEN UserAllowed% = 1LOOP

Statistics: Posted by Patz QuickBASIC Creations — Sun Jan 27, 2008 10:24 am


]]>
2008-01-26T22:05:59-05:00 2008-01-26T22:05:59-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=16491#p16491 <![CDATA[Fastest way to get Keyboard presses]]> So to back space I guess, it involves messing around with the LOCATE command...btw, do you know my problem? (With the INP command in my previous post :P )

Statistics: Posted by Sinuvoid — Sat Jan 26, 2008 10:05 pm


]]>
2008-01-26T21:55:36-05:00 2008-01-26T21:55:36-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=16490#p16490 <![CDATA[Fastest way to get Keyboard presses]]>
http://pastebin.ca/874102

Statistics: Posted by Patz QuickBASIC Creations — Sat Jan 26, 2008 9:55 pm


]]>
2008-01-26T21:49:59-05:00 2008-01-26T21:49:59-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=16489#p16489 <![CDATA[Fastest way to get Keyboard presses]]> Statistics: Posted by Sinuvoid — Sat Jan 26, 2008 9:49 pm


]]>
2008-01-26T19:44:09-05:00 2008-01-26T19:44:09-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=16487#p16487 <![CDATA[Your silly]]>

Code:

DO    scancode = INP(&H60)   LOCATE 5, 10: PRINT scancodeLOOP UNTIL scancode = 1  'escape key press
Notice that the release code is 128 more than the press code. The codes do not change for upper or lower cases either.

Ted

Statistics: Posted by burger2227 — Sat Jan 26, 2008 7:44 pm


]]>
2008-01-26T17:51:24-05:00 2008-01-26T17:51:24-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=16486#p16486 <![CDATA[Fastest way to get Keyboard presses]]> INP(&H60) doesn't work the same as INKEY$.

I'll check it out later for you.

Statistics: Posted by Seb McClouth — Sat Jan 26, 2008 5:51 pm


]]>
2008-01-26T16:52:48-05:00 2008-01-26T16:52:48-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=16485#p16485 <![CDATA[Fastest way to get Keyboard presses]]>

Now, can someone explain teh INP command in some detail please.
I'm using it to get input from the keyboard but when I use it, it like prints out 8 "Hey's" or whatever. What Im I doing wrong? Here's an example:

Code:

CLSDOk = INP(&H60)CASE SELECT kCASE 2PRINT "This is number 2";CASE 3PRINT "This is number 3";END SELECTLOOP

Statistics: Posted by Sinuvoid — Sat Jan 26, 2008 4:52 pm


]]>
2008-01-26T13:17:43-05:00 2008-01-26T13:17:43-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=16484#p16484 <![CDATA[Fastest way to get Keyboard presses]]>
2, How can I make letters typed in the INPUT command come out as *'s (exmaple, password program)
I'm used this routine in a older vrsion of QBinux:

Code:

        DO           PRINT tdspl$;"   " 'Display storing variable           press$ = INKEY$           IF press$ <THEN> 0 THEN                 sb = LEN(dspl$)                 Ndspl$ = MID$(dspl$, 1, (sb - 1))                 dspl$ = Ndspl$             ELSEIF press$ = CHR$(13) THEN                 EXIT DO          ELSE                 dspl$ = dspl$ + press$                 tdspl$=tdspl$ + "*"         END IF   END IF   LOOP 
I use locate to print it on the same line. The code is not written by me, just adapted by me. The code was written by Rattrapmax6.

Here's his code:
]Right.. I sat back and wrote a more simulated Password system, it asks for username, then the password.. and while you type the pasword it displays it as: "******"..

Very nice, and something you can play with, look over, and learn from maybe.. :wink:

Psssys.bas (Made in FreeBasic, Tested in QBasic.. Runs well in both..)

Code:

'Username/Password system by Rattrapmax6(Kevin(x.t.r.GRAPHICS))' Two test usernames: User1 and Admin'Passwords: User1 = Enter || Admin = LetMeIn' System is case-insensitive.. :)CLS 'Clear screenPRINT "Welcome!"PRINT "Enter User:";DO    LOCATE 2, 12: PRINT dspl$; "   " 'Display storing varible    press$ = INKEY$    IF press$ <THEN> 0 THEN            sb = LEN(dspl$)            Ndspl$ = MID$(dspl$, 1, (sb - 1))            dspl$ = Ndspl$        'Filter Enter, Exit for checking        ELSEIF press$ = CHR$(13) THEN            EXIT DO        'Add up user input to varible        ELSE            dspl$ = dspl$ + press$        END IF    END IFLOOPSELECT CASE UCASE$(dspl$)CASE "USER1"    PRINT "Enter Pasword:";    usr$ = dspl$    dspl$ = ""    DO        LOCATE 3, 15: PRINT pss$; "   "' NEW, print the ** for the varible        press$ = INKEY$        IF press$ <THEN> 0 THEN                sb = LEN(dspl$)                Ndspl$ = MID$(dspl$, 1, (sb - 1))                Npss$ = MID$(pss$, 1, (sb - 1)) 'NEW, Subtract ***                dspl$ = Ndspl$                pss$ = Npss$ 'Restore the ***            ELSEIF press$ = CHR$(13) THEN                EXIT DO            ELSE               dspl$ = dspl$ + press$               pss$ = pss$ + "*" 'NEW, calculate how many ***            END IF        END IF    LOOP    IF UCASE$(dspl$) = "ENTER" THEN         PRINT "Welcome to our servers, "; usr$; "!"        PRINT "Press any key to end..."        SLEEP        END    ELSE        PRINT "Username and password to not compute!"        PRINT "Press any key do end..."        SLEEP        END    END IFCASE "ADMIN"    PRINT "Enter Pasword:";    usr$ = dspl$    dspl$ = ""    DO        LOCATE 3, 15: PRINT pss$; "   "        press$ = INKEY$        IF press$ <THEN> 0 THEN                sb = LEN(dspl$)                Ndspl$ = MID$(dspl$, 1, (sb - 1))                Npss$ = MID$(pss$, 1, (sb - 1))                dspl$ = Ndspl$                pss$ = Npss$            ELSEIF press$ = CHR$(13) THEN                EXIT DO            ELSE               dspl$ = dspl$ + press$               pss$ = pss$ + "*"            END IF        END IF    LOOP    IF UCASE$(dspl$) = "LETMEIN" THEN         PRINT "Welcome to our servers, "; usr$; "!"        PRINT "Press any key to end..."        SLEEP        END    ELSE        PRINT "Username and password do not compute!"        PRINT "Press any key to end..."        SLEEP        END    END IFCASE ELSE    PRINT "No user under that name: Try again..."    PRINT "Press any key to end..."    SLEEP    ENDEND SELECT 
[/quote]

Statistics: Posted by Seb McClouth — Sat Jan 26, 2008 1:17 pm


]]>
2008-01-25T16:16:48-05:00 2008-01-25T16:16:48-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=16479#p16479 <![CDATA[Fastest way to get Keyboard presses]]> I've looked at tuts and QB help but no luck :(

EDIT: CHR$(what??)

Statistics: Posted by Sinuvoid — Fri Jan 25, 2008 4:16 pm


]]>
2008-01-25T18:37:35-05:00 2008-01-25T13:39:34-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=16478#p16478 <![CDATA[New thread?]]>
When a valid key is pressed, just print an asterisk. You can also allow backspacing by checking for Character code 8.

Apparently you cannot use CHR$ and (8) in a text here LOL.

INP(&H60) reads the keyboard scancodes. A key release is 128 more than the press value returned. Make a DO loop and just PRINT it. Use LOOP UNTIL code = 1, the escape key. Few of the scancodes are the same as ASCII.

INP is for reading a port value. OUT changes the values.

Ted

Statistics: Posted by burger2227 — Fri Jan 25, 2008 1:39 pm


]]>
2008-01-24T21:42:23-05:00 2008-01-24T21:42:23-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=16469#p16469 <![CDATA[Fastest way to get Keyboard presses]]> 2, I use INP because its fast :) and plus ive never used it Before so its good practise :P

EDIT: Ok, the INP isnt working for me. I've tried tut's but no luck. Can you guys explain it for me please :D

2, How can I make letters typed in the INPUT command come out as *'s (exmaple, password program)

Statistics: Posted by Sinuvoid — Thu Jan 24, 2008 9:42 pm


]]>
2008-01-24T21:31:16-05:00 2008-01-24T21:31:16-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=16468#p16468 <![CDATA[Fastest way to get Keyboard presses]]> Statistics: Posted by Patz QuickBASIC Creations — Thu Jan 24, 2008 9:31 pm


]]>