<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.xna.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>General</title><link>http://forums.xna.com/forums/32.aspx</link><description>Don't know where to post your question? Post it here!</description><dc:language>en</dc:language><generator>CommunityServer 2007.1 (Build: 0.0)</generator><item><title>Re: Which would you prefer....?</title><link>http://forums.xna.com/forums/thread/43585.aspx</link><pubDate>Mon, 28 Jan 2008 15:38:46 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:43585</guid><dc:creator>ShawMishrak</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/43585.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=32&amp;PostID=43585</wfw:commentRss><description>Perhaps this is another issue where feedback would be very useful.&lt;br&gt;&lt;br&gt;Currently, the input state information is propogated around the engine as messages, as LordIkon has stated.&amp;nbsp; This is a global event subscribable by all engine systems.&amp;nbsp; Every time the input system detects input state changes, this event handler is called with appropriate event types.&amp;nbsp; The system is very similar to the Windows message pump, with the exception of message types being derived classes from a common interface type.&amp;nbsp; Engine-level code would see something like:&lt;br&gt;&lt;br&gt;&lt;div style="background-color:White;"&gt;&lt;div style="margin:0px;padding:2px 2px 2px 8px;background-color:White;overflow-x:scroll;overflow-y:hidden;width:505px;"&gt;&lt;pre&gt;&lt;span style="color:Black;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;&lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;public&lt;/span&gt; &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;void&lt;/span&gt; MyMessageHandler(IMessage msg)&lt;br&gt;{&lt;br&gt;    &lt;span style="color:Green;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;// Process message type and perform appropriate logic&lt;/span&gt;&lt;br&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;br&gt;To game code, this approach may become somewhat messy.&amp;nbsp; However, this abstraction seems necessary to decouple the internal engine systems.&amp;nbsp; To accomodate a more clean interface for game-level code, an input mapper will be created.&amp;nbsp; This mapper will subscribe to and process input events, along with an internal key/button -&amp;gt; event name mapping, and maintain internal states.&amp;nbsp; Game-level code will then be able to make calls like:&lt;br&gt;&lt;br&gt;&lt;div style="background-color:White;"&gt;&lt;div style="margin:0px;padding:2px 2px 2px 8px;background-color:White;overflow-x:scroll;overflow-y:hidden;width:505px;"&gt;&lt;pre&gt;&lt;span style="color:Black;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;&lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;public&lt;/span&gt; &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;void&lt;/span&gt; Update(GameTime gameTime)&lt;br&gt;{&lt;br&gt;    &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;if&lt;/span&gt;(inputMapper.IsEventActive(MyEvents.MoveForward))  &lt;span style="color:Green;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;// Key/button bound to "MoveForward" is being pressed/held.&lt;/span&gt;&lt;br&gt;    {&lt;br&gt;    }&lt;br&gt;&lt;br&gt;    &lt;span style="color:Blue;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;if&lt;/span&gt;(inputMapper.IsEventJustFired(MyEvents.MenuItemActivate))  &lt;span style="color:Green;background-color:transparent;font-family:Courier New;font-size:11px;font-weight:normal;"&gt;// Key/button bound to "MenuItemActivate" was just pressed this frame.&lt;/span&gt;&lt;br&gt;    {&lt;br&gt;    }&lt;br&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;br&gt;&lt;br&gt;Clearly, input control is just one use of the messaging system.&lt;br&gt;&lt;br&gt;Comments?&lt;br&gt;</description></item><item><title>Re: Which would you prefer....?</title><link>http://forums.xna.com/forums/thread/43564.aspx</link><pubDate>Mon, 28 Jan 2008 13:29:39 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:43564</guid><dc:creator>Lord Ikon</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/43564.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=32&amp;PostID=43564</wfw:commentRss><description>The messages will be coming through the engines message handler via custom messages, and will be for mouse, keyboard, and gamepad.</description></item><item><title>Re: Which would you prefer....?</title><link>http://forums.xna.com/forums/thread/43558.aspx</link><pubDate>Mon, 28 Jan 2008 12:07:58 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:43558</guid><dc:creator>Johnhaw</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/43558.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=32&amp;PostID=43558</wfw:commentRss><description>&lt;P&gt;I'd do with Method2 as well.&amp;nbsp; I think the naming conventions are more descriptive of the controller state.&amp;nbsp;&amp;nbsp;&amp;nbsp;I would&amp;nbsp;want the threshold between Down and Held to be configurable.&lt;/P&gt;
&lt;P&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Do&amp;nbsp;these come as messages (a la Windows WM_LBUTTONDOWN), or as state&amp;nbsp;passed to an update call (i.e. a replacement for MouseState)?&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description></item><item><title>Re: Which would you prefer....?</title><link>http://forums.xna.com/forums/thread/43541.aspx</link><pubDate>Mon, 28 Jan 2008 09:54:11 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:43541</guid><dc:creator>Lord Ikon</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/43541.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=32&amp;PostID=43541</wfw:commentRss><description>&lt;P&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="http://forums.xna.com/Themes/default/images/icon-quote.gif"&gt; &lt;strong&gt;Kafeen:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;For naming conventions from your descriptions I'd say method 2 makes more sence.&amp;nbsp; Pressed and Released sound the button has just been pressed or released on that frame, so that's a little misleading based on your descriptions.&amp;nbsp; I also think that the functionality of the ButtonHeld is rather pointless since it's basicly going to provide the same information as ButtonDown with the exception that it won't report buttons that were only pressed this frame causing a one frame delay on any input using this command.&lt;BR&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/P&gt;
&lt;P&gt;Sending messages whenever a button is held allows you to perform actions that will occur only when a button is held. One thing I've run into in the past is a camera that moves whenever you hold in a mouse button (similar to World of Warcraft), but whenever you click a single or double mouse click you wouldn't want the camera reacting because you're likely interacting with UI.&lt;BR&gt;&lt;/P&gt;</description></item><item><title>Re: Which would you prefer....?</title><link>http://forums.xna.com/forums/thread/43534.aspx</link><pubDate>Mon, 28 Jan 2008 08:54:23 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:43534</guid><dc:creator>Kamujin</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/43534.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=32&amp;PostID=43534</wfw:commentRss><description>&lt;P&gt;ButtonUp = Single event for button transition from down to up.&lt;/P&gt;
&lt;P&gt;ButtonDown = Single event for button transition from up to down.&lt;/P&gt;
&lt;P&gt;ButtonPressed = Continuous&amp;nbsp;events for buttons that are&amp;nbsp;down.&lt;/P&gt;
&lt;P&gt;ButtonHeld = Continous events for buttons that are down for longer then a configurable time threshhold.&amp;nbsp; &lt;/P&gt;</description></item><item><title>Re: Which would you prefer....?</title><link>http://forums.xna.com/forums/thread/43525.aspx</link><pubDate>Mon, 28 Jan 2008 07:37:01 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:43525</guid><dc:creator>Mrmuzz</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/43525.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=32&amp;PostID=43525</wfw:commentRss><description>&lt;P&gt;Hmm, I would have been tempted by #3, given its most similar to the ButtonState.xxx enum that you'd use&amp;nbsp;via GamePadState...&lt;/P&gt;
&lt;P&gt;But then I guess this is meant to sit about that, and include keyboard input too.&lt;/P&gt;</description></item><item><title>Re: Which would you prefer....?</title><link>http://forums.xna.com/forums/thread/43524.aspx</link><pubDate>Mon, 28 Jan 2008 07:35:29 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:43524</guid><dc:creator>Matthew Knowles</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/43524.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=32&amp;PostID=43524</wfw:commentRss><description>For naming conventions from your descriptions I'd say method 2 makes more sence.&amp;nbsp; Pressed and Released sound the button has just been pressed or released on that frame, so that's a little misleading based on your descriptions.&amp;nbsp; I also think that the functionality of the ButtonHeld is rather pointless since it's basicly going to provide the same information as ButtonDown with the exception that it won't report buttons that were only pressed this frame causing a one frame delay on any input using this command.&lt;br&gt;&lt;br&gt;Personally for my own projects I have something similar to:&lt;br&gt;ButtonUp:&amp;nbsp;&amp;nbsp;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; Buttons that are up&lt;br&gt;ButtonDown:&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; Buttons that are down&lt;br&gt;ButtonPressed:&amp;nbsp;&amp;nbsp;&amp;nbsp; Buttons pressed this frame&lt;br&gt;ButtonReleased:&amp;nbsp;&amp;nbsp; Buttons released this frame&lt;br&gt;&lt;br&gt;Seems to cover anything I need.&lt;br&gt;</description></item><item><title>Re: Which would you prefer....?</title><link>http://forums.xna.com/forums/thread/43514.aspx</link><pubDate>Mon, 28 Jan 2008 06:37:10 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:43514</guid><dc:creator>Camp ELM</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/43514.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=32&amp;PostID=43514</wfw:commentRss><description>Based on your descriptions #2 makes the most sense to me.&amp;nbsp; The third option makes it seem like you're checking&amp;nbsp;for a button event like it was just pressed or released</description></item><item><title>Re: Which would you prefer....?</title><link>http://forums.xna.com/forums/thread/43489.aspx</link><pubDate>Sun, 27 Jan 2008 23:44:00 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:43489</guid><dc:creator>Nick Gravelyn</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/43489.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=32&amp;PostID=43489</wfw:commentRss><description>For those event descriptions I would go with #2. Reason being that the ButtonPressed event is relateable to the KeyPressed event in WinForms which is caused by a button being pressed and then released. So to ease confusion I would go with #2.&lt;br&gt;</description></item><item><title>Re: Which would you prefer....?</title><link>http://forums.xna.com/forums/thread/43488.aspx</link><pubDate>Sun, 27 Jan 2008 23:41:42 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:43488</guid><dc:creator>Joel Martinez</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/43488.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=32&amp;PostID=43488</wfw:commentRss><description>I'd cast my vote for method #2 simply because I prefer the language "button held". &lt;br&gt;</description></item><item><title>Which would you prefer....?</title><link>http://forums.xna.com/forums/thread/43486.aspx</link><pubDate>Sun, 27 Jan 2008 23:26:26 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:43486</guid><dc:creator>Lord Ikon</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/43486.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=32&amp;PostID=43486</wfw:commentRss><description>&lt;P&gt;We're working on an engine right now (&lt;A href="http://www.codeplex.com/quickstartengine"&gt;QuickStart Engine&lt;/A&gt;), and we've come across a simple question and would like your guys' input on it.&lt;/P&gt;
&lt;P&gt;If you were using an input manager for controls for your video game, which would you prefer as an&amp;nbsp;easy-to-understand button naming convention? Basically, which of the following schemes makes the most sense to you? And in your response if you could give a small comment on why it was the easiest to understand. And finally, if you think you've got a better one, feel free to post your suggestion. Thanks guys.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Method 1:&lt;/STRONG&gt;&lt;BR&gt;&lt;EM&gt;"ButtonUp"&lt;/EM&gt;: For buttons that are up.&lt;BR&gt;&lt;EM&gt;"ButtonDown"&lt;/EM&gt;: For buttons that are down.&lt;BR&gt;&lt;EM&gt;"ButtonPressed"&lt;/EM&gt;: For buttons that are down for more than 1 frame (being held down or pressed for a period of time).&lt;BR&gt;&lt;BR&gt;&lt;STRONG&gt;Method 2:&lt;BR&gt;&lt;/STRONG&gt;&lt;EM&gt;"ButtonUp"&lt;/EM&gt;: For buttons that are up.&lt;BR&gt;&lt;EM&gt;"ButtonDown"&lt;/EM&gt;: For buttons that are down.&lt;BR&gt;&lt;EM&gt;"ButtonHeld"&lt;/EM&gt;: For buttons that are down for more than 1 frame (being held down or pressed for a period of time).&lt;BR&gt;&lt;BR&gt;&lt;STRONG&gt;Method 3:&lt;BR&gt;&lt;/STRONG&gt;&lt;EM&gt;"ButtonReleased"&lt;/EM&gt;: For buttons that are up.&lt;BR&gt;&lt;EM&gt;"ButtonPressed"&lt;/EM&gt;: For buttons that are down.&lt;BR&gt;&lt;EM&gt;"ButtonHeld"&lt;/EM&gt;: For buttons that are down for more than 1 frame (being held down or pressed for a period of time).&lt;/P&gt;</description></item></channel></rss>