Jump to content

[LE] GetMappedKey returns -1 even when key assignment is valid


TimThe7th

Recommended Posts

I'm trying to pull up the stats menu under certain circumstances--for now, when the "ready Weapon" button is pressed, but I may change that later.

 

Regardless, I believe it requires me to fake a key press, and I'm getting stumped. If it's not mapped to a valid key, it will crash (and it has). So using a messagebox, I'm trying to check the key assignment. But no matter where I assign the Stats Menu, it always shows -1. I've tried P, ?/, Q, and other valid assignments, but it's returning -1 consistently.

 

Script is below--it's just getting started, so there's not much, but that's probably for the better.

Scriptname _CharAssign extends Quest  

Import Game
Import Actor
Import Utility

; ---------- Get Mapped Key

Int iStatsMenu

; ---------- Events

Event OnInit()

	RegisterForControl("Quick Stats")
	RegisterForControl("Ready Weapon")
	RegisterForMenu("StatsMenu")

endEvent

Event OnControlDown(string control)
	If control == "Ready Weapon"
		Utility.Wait(1)
 		iStatsMenu = Input.GetMappedKey("StatsMenu")
		Utility.Wait(1)
		;Input.TapKey(iStatsMenu)
		debug.messagebox(iStatsMenu)
	EndIf
EndEvent

Event OnMenuOpen(String MenuName)
	Utility.Wait(1)
	Debug.MessageBox("Test")
EndEvent

Link to comment
Share on other sites

  • Recently Browsing   0 members

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