<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>game pad | Learn C Games Programming Blog</title>
	<atom:link href="https://learncgames.com/tag/game-pad/feed/" rel="self" type="application/rss+xml" />
	<link>https://learncgames.com</link>
	<description>A blog about C, programming games and my ebook(s).</description>
	<lastBuildDate>Sat, 02 May 2020 15:31:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://learncgames.com/wp-content/uploads/2020/03/cropped-favicon-32x32.png</url>
	<title>game pad | Learn C Games Programming Blog</title>
	<link>https://learncgames.com</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">181446779</site>	<item>
		<title>Fun with game pads</title>
		<link>https://learncgames.com/fun-with-game-pads/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=fun-with-game-pads</link>
		
		<dc:creator><![CDATA[David]]></dc:creator>
		<pubDate>Tue, 12 May 2020 23:00:59 +0000</pubDate>
				<category><![CDATA[Other stuff]]></category>
		<category><![CDATA[game pad]]></category>
		<category><![CDATA[gameController]]></category>
		<category><![CDATA[guid]]></category>
		<guid isPermaLink="false">https://learncgames.com/?p=572</guid>

					<description><![CDATA[<p>I&#8217;ve never dealt with a game pad (joypad etc.) before. It seems that there is no absolute mapping, it&#8217;s more like TV remote controls. There&#8217;s lots of them and they&#8217;re all different. So although SDL2 has a set of enum values for the buttons, I found that my game pad wasn&#8217;t responding to what I [&#8230;]</p>
The post <a href="https://learncgames.com/fun-with-game-pads/">Fun with game pads</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></description>
										<content:encoded><![CDATA[<div class='__iawmlf-post-loop-links' style='display:none;' data-iawmlf-post-links='[{&quot;id&quot;:728,&quot;href&quot;:&quot;https:\/\/github.com\/gabomdq\/SDL_GameControllerDB&quot;,&quot;archived_href&quot;:&quot;http:\/\/web-wp.archive.org\/web\/20240115133452\/https:\/\/github.com\/gabomdq\/SDL_GameControllerDB&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2026-02-06 17:55:04&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-13 06:20:11&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-17 00:25:38&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-20 17:42:11&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-24 23:14:15&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-01 01:04:45&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-10 10:21:33&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-15 16:30:48&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-20 03:08:41&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-02 20:59:20&quot;,&quot;http_code&quot;:206}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-04-02 20:59:20&quot;,&quot;http_code&quot;:206},&quot;process&quot;:&quot;done&quot;},{&quot;id&quot;:729,&quot;href&quot;:&quot;http:\/\/www.generalarcade.com\/gamepadtool&quot;,&quot;archived_href&quot;:&quot;http:\/\/web-wp.archive.org\/web\/20260203182251\/https:\/\/generalarcade.com\/gamepadtool\/&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2026-02-06 17:55:06&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-13 06:20:10&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-17 00:25:37&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-20 17:42:09&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-24 23:14:14&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-01 01:04:44&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-05 10:04:56&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-10 10:21:32&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-15 16:30:47&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-20 03:08:40&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-02 20:59:19&quot;,&quot;http_code&quot;:206}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-04-02 20:59:19&quot;,&quot;http_code&quot;:206},&quot;process&quot;:&quot;done&quot;},{&quot;id&quot;:730,&quot;href&quot;:&quot;https:\/\/raw.githubusercontent.com\/gabomdq\/SDL_GameControllerDB\/master\/gamecontrollerdb.txt&quot;,&quot;archived_href&quot;:&quot;http:\/\/web-wp.archive.org\/web\/20251222020848\/https:\/\/raw.githubusercontent.com\/gabomdq\/SDL_GameControllerDB\/master\/gamecontrollerdb.txt&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2026-02-06 17:55:08&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-13 06:20:15&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-17 00:25:37&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-20 17:42:09&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-25 15:01:09&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-01 01:04:44&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-11 00:33:11&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-15 16:30:48&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-20 03:08:40&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-02 20:59:19&quot;,&quot;http_code&quot;:206}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-04-02 20:59:19&quot;,&quot;http_code&quot;:206},&quot;process&quot;:&quot;done&quot;},{&quot;id&quot;:731,&quot;href&quot;:&quot;https:\/\/wiki.libsdl.org\/CategoryGameController&quot;,&quot;archived_href&quot;:&quot;&quot;,&quot;redirect_href&quot;:&quot;SDL3\/CategoryGameController&quot;,&quot;checks&quot;:[],&quot;broken&quot;:false,&quot;last_checked&quot;:null,&quot;process&quot;:&quot;done&quot;}]'></div>
<p><img fetchpriority="high" decoding="async" class="alignleft size-full wp-image-573" src="https://learncgames.com/wp-content/uploads/2020/05/gamepad_tool.png" alt="Gamepad Tool" width="572" height="672" srcset="https://learncgames.com/wp-content/uploads/2020/05/gamepad_tool.png 572w, https://learncgames.com/wp-content/uploads/2020/05/gamepad_tool-255x300.png 255w" sizes="(max-width: 572px) 100vw, 572px" />I&#8217;ve never dealt with a game pad (joypad etc.) before. It seems that there is no absolute mapping, it&#8217;s more like TV remote controls. There&#8217;s lots of them and they&#8217;re all different. So although SDL2 has a set of enum values for the buttons, I found that my game pad wasn&#8217;t responding to what I thought were the game keys.</p>
<p>But SDL2 to the rescue.  The SDL_GameController has a flexible scheme where the game pad can be setup by a text string. There&#8217;s a database of schemes available on <a title="Link to SDL_GameControllerDB on Github" href="https://github.com/gabomdq/SDL_GameControllerDB" target="_blank" rel="noopener noreferrer">Github</a>. That includes a couple of tools for discerning what the setup for your game pad is. That&#8217;s one of them shown. <a title="Link to Game Pad tool" href="http://www.generalarcade.com/gamepadtool/" target="_blank" rel="noopener noreferrer">That program</a> from General Arcade is free and cross-platform. I downloaded and ran it on Windows with my game pad attached.</p>
<p>So, my controller is a NEXT SNES Controller (no surprises there) and the setup string for it is <em>030000001008000001e5000000000000,NEXT SNES Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b6,start:b9,x:b3,y:b0,platform:Windows</em>.</p>
<p>There&#8217;s a database of these on Github and it currently has 780 odd strings. You can view it <a title="Link to Game Controller Database (text file)" href="https://raw.githubusercontent.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt" target="_blank" rel="noopener noreferrer">here</a> though it&#8217;s not that great a read!</p>
<p>So I think the idea is, you can include that file in your application and any game that uses game pads can get the GUID from the game pad via one of the SDL calls- see this list of <a title="Link to list of SDL GameController functions" href="https://wiki.libsdl.org/CategoryGameController" target="_blank" rel="noopener noreferrer">SDL GameController</a> functions and load the file into memory et voila, your application can now use the game pad.</p>The post <a href="https://learncgames.com/fun-with-game-pads/">Fun with game pads</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">572</post-id>	</item>
	</channel>
</rss>
