Jump to content

charselect keyboard input


Recommended Posts

Hey, i managed to add keyboard functionality to my charselect. And everything works fine, for the first login/charselect.

 

def OnKeyDown(self, key):

			if 1 == key:
				self.ExitSelect()
			elif 2 == key:
				self.SelectSlot(0)
			elif 3 == key:
				self.SelectSlot(1)
			elif 4 == key:
				self.SelectSlot(2)
			elif 5 == key:
				self.SelectSlot(3)
			elif 6 == key:
				self.SelectSlot(4)

			elif 28 == key or 57 == key:
				id = net.GetAccountCharacterSlotDataInteger(self.slot, net.ACCOUNT_CHARACTER_SLOT_ID)
				if 0 == id:
					self.CreateCharacter()
				else:
					self.StartGame()

			elif 203 == key:
				self.DecreaseSlotIndex()
			elif 205 == key:
				self.IncreaseSlotIndex()

			return True

 

But once I entered ingame, when I go back to the charselect screen, the keyboard inputs aren't processed anymore. Only by clicking the arrows/buttons with the mouse, I can navigate in that menu.
How can i fix this?

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now


×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.