FOSE and detecting disabled key presses

Post » Sat Jan 29, 2011 9:01 am

The documentation states that keys or controls disabled using disablekey, or disablecontrol will still be detected by iskeypressed or iscontrolpressed. For me it doesn't work that way. Mouse buttons assigned to the disabled button continue to be detected, but disabled keyboard buttons are not detected by iskey or control pressed.

Anyone else using this function and have it working like it is supposed to? I need to disable say the forward key so the player can't move forward, but still need to know when that key is pressed.
User avatar
Tinkerbells
 
Posts: 3432
Joined: Sat Jun 24, 2006 10:22 pm

Post » Sat Jan 29, 2011 2:15 am

You could try using getControl/setControl. So, for example, you wanna disable moving forward
; Disable by unbinding it so it still can be detectedset oldkey to getControl 0setControl 0 -1 ;i think this unbinds it, but I'm not sure; Enable by rebinding it to the old keysetControl 0 oldkey; Detect key pressif isKeyPressed oldKey == 1...endif

Use with caution though :)
User avatar
victoria gillis
 
Posts: 3329
Joined: Wed Jan 10, 2007 7:50 pm

Post » Fri Jan 28, 2011 11:23 pm

Nice workaround schlangster. That works great.
User avatar
Emma Parkinson
 
Posts: 3401
Joined: Wed Jul 26, 2006 5:53 pm


Return to Fallout 3