Multikey And Text Mode.

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

Multikey And Text Mode.

Postby MystikShadows » Sep 12, 2008 10:22

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

Postby phishguy » Sep 12, 2008 11:46

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

Postby Antoni » Sep 12, 2008 11:54

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

Postby MystikShadows » Sep 12, 2008 15:31

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

Postby phishguy » Sep 12, 2008 15:43

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:

Postby MystikShadows » Sep 12, 2008 22:42

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

Postby wolfstar » Sep 13, 2008 11:10

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....

Return to “General”

Who is online

Users browsing this forum: No registered users and 17 guests