A look at OpenKODE, and it's first widespread commercial implementation Airplay. This presentation was given as part of the OverTheAir event on 4th April 08, and included a large portion of "live coding".
18. OpenKODE Core – implementation // Symbian (assume main game class derived from required base class) TKeyResponse CMyAppCnt::OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType) { if (aType == EEventKey && aKeyEvent.iCode == SYMBIAN_KEY_CODE) { // Do whatever } } // Brew (assume main game class derived from required base class) void GameMainCanvas::keyPress(uint16 key) { if (key == BREW_KEY_CODE) { // Do whatever } } // Windows Mobile - standard window message handler LRESULT CALLBACK s3eWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { if (uMsg == case WM_KEYDOWN && wParam == WINMOBILE_KEY_CODE) { // Do whatever } }
19. OpenKODE Core – implementation #include "KD/kd.h" int kdMain(KDint argc, const KDchar* argv[]) { while(1) { // Update events, including keyboard. kdPumpEvents(); // Poll the state of 'Game key A' and put the result in // res. Game key A should be mapped onto whatever is the // device's normal fire button, so the game developer doesn't // have to worry about what that is. int res = 0; kdInputPollb(KD_IO_GAMEKEYS_A, 1, &res); // Now see if our key is pressed. if (res) { // Do whatever. kdAssert(("It's been pressed", 0)); } } } In OpenKODE Core, the keypress example above reduces to the following:
25. Metal Gear Solid™ Mobile Metal Gear Solid™ Mobile now released, Verizon and KDDI Winner “Best Game”, IMGA awards, Barcelona Feb 08 Winner “Operators’ Choice”, IMGA awards, Barcelona Feb 08