Qbasicnews.com

Full Version: i need somthing other than inkey$ like inkey$...
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
im making a simple os and it uses menus and sub menus. the menu is already utilizing inkey$ and i need somthing that will allow the user to press "m" and it will chain to a small sub named mimenu while still being able to browse the menu with the aarow keys. :???: :???: :???: help?
It would help more if we could see your code.
well
in qb there is INP(96) which is the keyboard port. it gives a code when a key is pressed, and that number +128 (i think) when it is released.
If you are using FB, which i strongly recommend if possible, you can just use Multikey(num).
I would post the code up here but i cant find a program to let me copy/paste inbetween QB and windows. Do you guys know of any?
Just save your program, then open it with NotePad. The code will be there and ready for you to copy and paste it where ever you need it... :wink:
oh im dumb!
here it is.

SUB mmenu
COLOR 2
LINE (1000, 6770)-(105, 800)
Opt% = 1
LOCATE 15, 35
PRINT "APPLICATIONS"
LOCATE 16, 35
PRINT "MY PC"
LOCATE 17, 35
PRINT "ENTERTAINMENT"
LOCATE 18, 35
PRINT "EXIT"
invent% = 0

DO
COLOR 15
IF Opt% = 1 THEN
LINE (250, 228)-(268, 292), 0, BF
PUT (250, 228), pointer
END IF

IF Opt% = 2 THEN
LINE (250, 228)-(268, 292), 0, BF
PUT (250, 244), pointer
END IF

IF Opt% = 3 THEN
LINE (250, 228)-(268, 292), 0, BF
PUT (250, 260), pointer
END IF

IF Opt% = 4 THEN
LINE (250, 228)-(268, 292), 0, BF
PUT (250, 276), pointer
END IF

DO
k$ = INKEY$
LOOP WHILE k$ = ""

SELECT CASE k$
CASE CHR$(0) + CHR$(72)
IF Opt% = 1 THEN Opt% = 4 ELSE Opt% = Opt% - 1
CASE CHR$(0) + CHR$(80)
IF Opt% = 4 THEN Opt% = 1 ELSE Opt% = Opt% + 1
CASE CHR$(13)
EXIT DO
CASE CHR$(9)
invent% = 1: EXIT DO

END SELECT

LOOP
IF invent% = 1 THEN PRINT "Zoaster Operating System"'inven
IF Opt% = 1 THEN APPS
IF Opt% = 2 THEN zpc
IF Opt% = 3 THEN enter
IF Opt% = 4 THEN END
Well. First of all, you're programming a GUI (Graphical User Interface), not an OS (Operating System). Second, this is a poor way to to this. What you should do, rather, is have a main loop that is constantly updating the screen, checking mouse coordinates/mouse buttons, and checking which key(s) are pressed. Then you would act accordingly. Otherwise when a user accesses the menu, then the rest of the screen locks up. This way, you can make it so that the user can be doing more than one thing at once. Hope this makes sense.
first of all, i know what a GUI is and what a operating system is. im not an idiot. GUI is a type of os interface. secondly this could be considered an os. Was win3.2 an os? it ran over the CLI MS-DOS,and mine runs over the CLI FREEDOS. they both are GUIs,and they are both operating systems.

that said thanks for the help! Big Grin
Quote:first of all, i know what a GUI is and what a operating system is. im not an idiot. GUI is a type of os interface. secondly this could be considered an os. Was win3.2 an os? it ran over the CLI MS-DOS,and mine runs over the CLI FREEDOS. they both are GUIs,and they are both operating systems.

that said thanks for the help! Big Grin
An OS handles memory, disk access etc.. it also makes pretty interfaces for communicating with hardware..

You are still making a GUI

Windows does a few more things than act as a pretty shell for DOS
oh ok.
Pages: 1 2