Multikey And Text Mode.

General FreeBASIC programming questions.
Post Reply
MystikShadows
Posts: 612
Joined: Jun 15, 2005 13:22
Location: Upstate NY
Contact:

Multikey And Text Mode.

Post by MystikShadows »

Hi everyone,

Ok, I have this program that test if the user pressed SHIFT (any of them).

If I'm in graphics mode that works great with Multikey. But of I'm in regular text mode (SCREEN 0), SHIFT isn't being detected at all.

If multikey doesn't work in text mode, is there another way to get the status of the shift keys (or CTRL or ALT)? I don't want to call this a bug until someone tells me that multikey should work in SCREEN 0

I'm using FB 0.20.0b running in Windows XP SP2 if that helps.

Thanks
phishguy
Posts: 1201
Joined: May 05, 2006 16:12
Location: West Richland, Wa

Post by phishguy »

It works for me. FB 0.20.0b. Win2K.

Code: Select all

do
    locate 1,1
if multikey(42) then 
    print "Shift pressed"
else
    cls
    end if
sleep 1
loop until inkey$ = chr$(27)
 
Antoni
Posts: 1393
Joined: May 27, 2005 15:40
Location: Barcelona, Spain

Post by Antoni »

phishguy code works for me
FB0.20 in WinXP SP3 here
MystikShadows
Posts: 612
Joined: Jun 15, 2005 13:22
Location: Upstate NY
Contact:

Post by MystikShadows »

Weird.

I tried with the enumeration for FB Keys and with 42 and it doesn't want to work. hmmm
phishguy
Posts: 1201
Joined: May 05, 2006 16:12
Location: West Richland, Wa

Post by phishguy »

I tried the above code using fb.sc_lshift and fb.sc_rshift. They both work ok for me. However, it doesn't differentiate between a right or left shift for me.
MystikShadows
Posts: 612
Joined: Jun 15, 2005 13:22
Location: Upstate NY
Contact:

Post by MystikShadows »

Hmm weird...just before I push this any further...I'm gonne delete and reinstall freebasic 0.20.0b and see what happens.

I'll let you know when it's reinstalled.
wolfstar
Posts: 96
Joined: Nov 07, 2006 12:42

Post by wolfstar »

Do you have windows sticky keys on? The program can act differently depending on whether it's on or not. Just thought I'd mention....
Post Reply