You need to set you controls how you want them in RetroArch directly in order to have you controls how you want them in a game. Retroarch will allow you to bind both a keyboard key and a controller button to each input. In the image you attached you have keyboard keys mapped in RetroArch already. It looks like your directional inputs are linked to numeric pad keys 8,2,4,6. If your keyboard has up, down, left, right arrow keys this may be why when you press them in a game nothing happens. The commands are mapped to the numeric pad keys and not the arrow keys. You need to rebind them to the keys you want.