开发者

How to map controls to physical keyboard locations

I've been wanting to create a game engine, but I want to sort out some issues such as how to do controls. Is it possible to map controls to the physical locations on the keyboard as opposed to the individual keys themselves?

I would like to do this because I think that simply config开发者_如何学运维uring to controls like "W" for up and "S" for down is a nuisance for anyone who isn't using qwerty and needs to reconfigure to the locations intended by the creators of a game, which would include Dvorak users like myself or anyone who just decides to change the system default.

I'll probably be using C++ with Boost, SFML and Qt if that matters.


Probably the best way to do it would to simply have the controls in a .ini or text file, and then the user can configure it from there. Or else, a menu in the game from which you can select a key. i.e. "Press the key for up" etc. In terms of physical layouts, there aren't really any standards.

Anyway, even those using qwerty keyboards way want to customise their keys e.g. roguelike keys.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜