Changeset 2009


Ignore:
Timestamp:
Oct 12, 2012, 1:04:13 AM (5 years ago)
Author:
sam
Message:

input: add the Keyboard abstraction object type.

Location:
trunk/src
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/Makefile.am

    r1987 r2009  
    4545    \
    4646    input/input.cpp input/input.h \
     47    input/keyboard.cpp input/keyboard.h \
    4748    input/stick.cpp input/stick.h \
    4849    \
  • trunk/src/core.h

    r1987 r2009  
    9292#include "scene.h"
    9393#include "input/input.h"
     94#include "input/keyboard.h"
    9495#include "input/stick.h"
    9596#include "profiler.h"
  • trunk/src/input/input.h

    r1897 r2009  
    2323
    2424#include "lol/math/vector.h"
     25#include "input/keyboard.h"
    2526#include "input/stick.h"
    2627
     
    433434
    434435    /* These methods are called by the underlying input listeners */
     436    /* FIXME: this should disappear and be replaced by an input
     437     * system that abstracts mice */
    435438    static void SetMousePos(ivec2 coord);
    436439    static void SetMouseButton(int index);
    437440    static void UnsetMouseButton(int index);
    438441
     442    /* Keyboard handling */
     443    static Keyboard *CreateKeyboard();
     444    static void DestroyKeyboard(Keyboard *keyboard);
     445
     446    static Keyboard *TrackKeyboard(int desired);
     447    static void UntrackKeyboard(Keyboard *keyboard);
     448
    439449    /* Joystick handling */
    440450    static Stick *CreateStick();
  • trunk/src/lolcore.vcxproj

    r1987 r2009  
    267267    <ClCompile Include="image\image.cpp" />
    268268    <ClCompile Include="input\input.cpp" />
     269    <ClCompile Include="input\keyboard.cpp" />
    269270    <ClCompile Include="input\stick.cpp" />
    270271    <ClCompile Include="layer.cpp" />
     
    576577    <ClInclude Include="image\image.h" />
    577578    <ClInclude Include="input\input.h" />
     579    <ClInclude Include="input\keyboard.h" />
    578580    <ClInclude Include="input\stick.h" />
    579581    <ClInclude Include="layer.h" />
  • trunk/src/lolcore.vcxproj.filters

    r1987 r2009  
    137137      <Filter>src\input</Filter>
    138138    </ClCompile>
     139    <ClCompile Include="input\keyboard.cpp">
     140      <Filter>src\input</Filter>
     141    </ClCompile>
    139142    <ClCompile Include="input\stick.cpp">
    140143      <Filter>src\input</Filter>
     
    704707    </ClInclude>
    705708    <ClInclude Include="input\input.h">
     709      <Filter>src\input</Filter>
     710    </ClInclude>
     711    <ClInclude Include="input\keyboard.h">
    706712      <Filter>src\input</Filter>
    707713    </ClInclude>
  • trunk/src/platform/sdl/sdlinput.cpp

    r1808 r2009  
    5656{
    5757#if defined USE_SDL
     58    /* Enable Unicode translation of keyboard events */
     59    SDL_EnableUNICODE(1);
     60
    5861    SDL_Init(SDL_INIT_TIMER | SDL_INIT_JOYSTICK);
    5962
     
    162165#if 0
    163166        case SDL_KEYDOWN:
    164             Input::KeyPressed(event.key.keysym.sym, seconds);
     167            if (event.key.keysym.unicode)
     168                fprintf(stderr, "%c (0x%04X)\n", event.key.keysym.unicode, event.key.keysym.unicode);
    165169            break;
    166170#endif
Note: See TracChangeset for help on using the changeset viewer.