Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Camera KeyState

Author
Message
Grenadiac111
14
Years of Service
User Offline
Joined: 23rd Dec 2009
Location:
Posted: 17th Jan 2010 20:16
in my game im trying to make the camera move when certain keystate keys are pressed. but when i use an if then testing for keystate 18 and have dbMoveCamera (5); as a result nothing happens. can someone please tell me how to set up an if then statement with a keystate that will control the camera.
Aldur
17
Years of Service
User Offline
Joined: 8th Oct 2007
Location: Melbourne, Australia
Posted: 18th Jan 2010 08:22
This should work:
(Put it inside your main game loop)



Grenadiac111
14
Years of Service
User Offline
Joined: 23rd Dec 2009
Location:
Posted: 19th Jan 2010 05:43
just wondering what is the difference betwwen just typing (dbKeyState(18) == 1) and (dbKeyState(18)).
Grenadiac111
14
Years of Service
User Offline
Joined: 23rd Dec 2009
Location:
Posted: 19th Jan 2010 05:55
well i found the problem your code works fine but it turns out that my logitech G15 keybord cant return scancodes i geuss because it requires a driver to opperate, my laptop can run the code just fine, anyway thanks for the help.
Aldur
17
Years of Service
User Offline
Joined: 8th Oct 2007
Location: Melbourne, Australia
Posted: 19th Jan 2010 11:33
That's weird, I have the G15 as well, without the drivers installed and it still works.

Well i'm glad it's working for you!

Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 19th Jan 2010 12:22
Quote: "just wondering what is the difference betwwen just typing (dbKeyState(18) == 1) and (dbKeyState(18)). "


in the first one, you check if dbKeyState(18) returns 1, in the second one you check if it returns a true value ( a true value is anything except the 0 )
in this case, both will do the same job since dbKeyState() only returns 1(true) or 0(false)

Marsh0
15
Years of Service
User Offline
Joined: 18th Mar 2009
Location:
Posted: 19th Jan 2010 16:37
I also have a G15 and it seems to work, odd.

www.touchofdeathproductions.com
Grenadiac111
14
Years of Service
User Offline
Joined: 23rd Dec 2009
Location:
Posted: 20th Jan 2010 03:12
i have the old beta version with a flip screen the new ones may use a different driver or my driver may be glitching on my Windows 7 computer or it could be because my keybord is plugged into a laptop.

Login to post a reply

Server time is: 2024-11-20 05:31:46
Your offset time is: 2024-11-20 05:31:46