Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Chumper

Pages: [1]
1
Window / Save Inputs to File
« on: November 28, 2010, 10:11:41 pm »
So there is no other chance to make it easier than to enumerate the whole Keyboard and transfer the string "w" to Event::Key::W.

Your Idea would be to represent the whole keyboard with numbers, but that is still a lot of work, just think about the numblock, the F-Keys and the normal Controlkeys like Shift, Control, Alt, Left, Down, etc...

Anyways, thanks for your thoughts, i think i will use the numbers.

2
Window / Save Inputs to File
« on: November 28, 2010, 09:42:41 pm »
Hi everybody,

I am currently writing a small Game with Sfml 1.6.
It is a Clone of Ipcurve.

I managed dynamic Keybindings, but at the Moment they are still hardcoded.
That's why I want to save this Keybindings to a .ini-File.

But how can I do that?

I have used this tutorial for the Keybindings:
http://www.sfml-dev.org/wiki/en/tutoriels/bindevents_en

but how can i save that to an .ini-File like this?

Code: [Select]

[PLAYER1]
up=w
left=a
right=d
R=255
G=0
B=0


in short:
How can I get from

a string "w" to Event::Key::W?

And how can I save Event::Key::W to a File?

Cheers Nils

Pages: [1]