Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

soconne

game editor gui problem

This topic is 5403 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m writing my own level editor and I have a really stupid simple problem I cannot seem to solve. I have a list box with options for the user to choose from, and the user also uses the arrow keys to move around in the scene. Well if the list box just had the focus, then items get selected sequentially as the key buttons are pressed, since you can press up and down in a list box. How do I prevent this from happening? I went into the KeyPress event of the list box and set the ''Key'' value to Key=''\0'' to try and cancel it out, and it works for all other keys except the arrow keys. Any ideas?

Share this post


Link to post
Share on other sites
Advertisement
I suppose you could override the arrow keys and tell them to set focus to your window/view, as well as doing whatever they normally do. It’s just an idea, there probably is a better way of achieving what you want.

Share this post


Link to post
Share on other sites
quote:
Original post by IronBat
I suppose you could override the arrow keys and tell them to set focus to your window/view, as well as doing whatever they normally do. It’s just an idea, there probably is a better way of achieving what you want.
Thats what i did for another project. Works great for me...

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I had that problem - what I did was to get the user to enable selecting an item from the list by clicking on it, and once an item is click in list is again disabled. Also are you doing this is VB by any chance!

Share this post


Link to post
Share on other sites
If you''re using Win32, look into "subclassing a WindowProc," where you can change the WindowProc of an existing window, and re-route specific messages. Then pass all other messages on to the previous WindowProc.

Share this post


Link to post
Share on other sites
Thanks for your input guys, but I figured it out. It was pretty simple. I simply set Key=0 in both the ''KeyDown'' and ''KeyPress'' events. ''KeyPress'' took care of alpha and numeric characters, and ''KeyDown'' took care of the arrow keys.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!