# Getting keymap data from OS using SDL 1.3/2.0

**URL:** <https://discourse.libsdl.org/t/getting-keymap-data-from-os-using-sdl-1-3-2-0/15247>\
**Category:** SDL Development\
**Created:** [April 13, 2008, 7:01am UTC](https://discourse.libsdl.org/t/getting-keymap-data-from-os-using-sdl-1-3-2-0/15247 "2008-04-13T07:01:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sreyas\_k](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/s/9fc348/32.png) [@sreyas\_k](https://discourse.libsdl.org/u/sreyas_k)\
**Post date:** [April 13, 2008, 7:01am UTC](https://discourse.libsdl.org/t/getting-keymap-data-from-os-using-sdl-1-3-2-0/15247/1 "2008-04-13T07:01:13Z")

</div>

Hi,

Does SDL 1.3/2.0 has any feature by which we can get the keymap data from  
the OS?

Regards,  
Sreyas

---

<div class="post-metadata">

**Author:** ![Bob\_Pendleton](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/b/9de053/32.png) [@Bob\_Pendleton](https://discourse.libsdl.org/u/Bob_Pendleton)\
**Post date:** [April 13, 2008, 8:54pm UTC](https://discourse.libsdl.org/t/getting-keymap-data-from-os-using-sdl-1-3-2-0/15247/2 "2008-04-13T20:54:49Z")

</div>

No, not really. What1.3/2.0 does is provide the actual key that was pressed  
rather than just the character generated by the key press. It also gives you  
the character and supports unicode input.

To really answer your question I need to know what you are trying to do.

Bob PendletonOn Sun, Apr 13, 2008 at 2:01 AM, sreyas k \<k.sreyas at [gmail.com](http://gmail.com)\> wrote:

> Hi,
> 
> Does SDL 1.3/2.0 has any feature by which we can get the keymap data from  
> the OS?
> 
> Regards,  
> Sreyas
> 
> * * *
> 
> SDL mailing list  
> SDL at [lists.libsdl.org](http://lists.libsdl.org)  
> [http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)

–

- Bob Pendleton: writer and programmer
- email: Bob at [Pendleton.com](http://Pendleton.com)
- web: [www.GameProgrammer.com](http://www.GameProgrammer.com)
- [www.Wise2Food.com](http://www.Wise2Food.com)

±-------------------------------------+

---

<div class="post-metadata">

**Author:** ![sreyas\_k](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/s/9fc348/32.png) [@sreyas\_k](https://discourse.libsdl.org/u/sreyas_k)\
**Post date:** [April 14, 2008, 12:10am UTC](https://discourse.libsdl.org/t/getting-keymap-data-from-os-using-sdl-1-3-2-0/15247/3 "2008-04-14T00:10:12Z")

</div>

> No, not really. What1.3/2.0 does is provide the actual key that was  
> pressed rather than just the character generated by the key press. It also  
> gives you the character and supports unicode input.
> 
> To really answer your question I need to know what you are trying to do.
> 
> Bob Pendleton
> 
> > Hi,
> > 
> > Does SDL 1.3/2.0 has any feature by which we can get the keymap data  
> > from the OS?
> > 
> > Regards,  
> > Sreyas
> 
> I wanted to know if an api was there so that the entire keymap can be  
> gotten from the OS. I already know that we can detect keypresses. I am  
> working on the tuxtype typing tutor, in which the keymap details were put  
> into a file named keyboard.lst  
> The format of the file is  
> Finger|Keypress

It would be nice if we could remove that file and directly import the keymap  
from the OS. I saw an idea for this year’s Google SOC regarding this. SO I  
would like to know if there is any feature in SDL to implement this.

Regards,  
SreyasOn Mon, Apr 14, 2008 at 2:24 AM, Bob Pendleton wrote:

> On Sun, Apr 13, 2008 at 2:01 AM, sreyas k \<@sreyas\_k\> wrote:
