Jump to content

OnKeyUp


Recommended Posts

Inside the event:

Event OnKeyUp(Int code,Float HoldTime)

I have this:

ElseIf  code == inventory_key && !Utility.IsInMenuMode()	&& HoldTime < 1			;default key is 51, this is the ',' key
		dz_inventory_hotkey()
		Return
ElseIf  code == inventory_key && !Utility.IsInMenuMode()	;secondary use for this key, hold for longer than one second
		dz_inventory_open_hotkey()
		Return
.................

This works, but if I alter it to this:

ElseIf  code == inventory_key && !Utility.IsInMenuMode()	&& HoldTime < 1			;default key is 51, this is the ',' key
		dz_inventory_hotkey()
		Return
ElseIf  code == inventory_key && !Utility.IsInMenuMode()	&& HoldTime >= 1 && Holdtime < 5		;secondary use for this key, hold for longer than one second
		dz_inventory_open_hotkey()
		Return
ElseIf	code == inventory_key && !Utility.IsInMenuMode()	&& HoldTime >= 5
		dz_open_container()
		Return
  ........................................

Then no matter how long I hold the key the third elseif doesn't fire but the second does, is the comparison:

&& Holdtime < 5

is the second elseif not being assessed?

Should this work?

 

diziet

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...