~ubuntu-branches/debian/sid/stella/sid

« back to all changes in this revision

Viewing changes to src/gui/DialogContainer.cxx

  • Committer: Package Import Robot
  • Author(s): Stephen Kitt
  • Date: 2012-02-05 08:09:05 UTC
  • mfrom: (1.1.12)
  • Revision ID: package-import@ubuntu.com-20120205080905-9ej05rmkibowsm7j
Tags: 3.5.5-1
* New upstream version.
* Rewrite debian/copyright, using DEP-5 and updating for 2012.
* Update manpage.

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
//  SS  SS   tt   ee      ll   ll  aa  aa
9
9
//   SSSS     ttt  eeeee llll llll  aaaaa
10
10
//
11
 
// Copyright (c) 1995-2011 by Bradford W. Mott, Stephen Anthony
 
11
// Copyright (c) 1995-2012 by Bradford W. Mott, Stephen Anthony
12
12
// and the Stella Team
13
13
//
14
14
// See the file "License.txt" for information on usage and redistribution of
15
15
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
16
16
//
17
 
// $Id: DialogContainer.cxx 2199 2011-01-01 16:04:32Z stephena $
 
17
// $Id: DialogContainer.cxx 2356 2012-01-14 22:00:54Z stephena $
18
18
//============================================================================
19
19
 
20
20
#include "OSystem.hxx"
56
56
  // Key still pressed
57
57
  if(myCurrentKeyDown.keycode != 0 && myKeyRepeatTime < myTime)
58
58
  {
59
 
    activeDialog->handleKeyDown(myCurrentKeyDown.ascii, myCurrentKeyDown.keycode,
60
 
                                myCurrentKeyDown.flags);
 
59
    activeDialog->handleKeyDown(myCurrentKeyDown.keycode, myCurrentKeyDown.flags,
 
60
                                myCurrentKeyDown.ascii);
61
61
    myKeyRepeatTime = myTime + kRepeatSustainDelay;
62
62
  }
63
63
 
151
151
}
152
152
 
153
153
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
154
 
void DialogContainer::handleKeyEvent(int ascii, int key, int mod, uInt8 state)
 
154
void DialogContainer::handleKeyEvent(StellaKey key, StellaMod mod,
 
155
                                     char ascii, bool state)
155
156
{
156
157
  if(myDialogStack.empty())
157
158
    return;
158
159
 
159
160
  // Send the event to the dialog box on the top of the stack
160
161
  Dialog* activeDialog = myDialogStack.top();
161
 
  if(state == 1)
 
162
  if(state)
162
163
  {
163
 
    myCurrentKeyDown.ascii   = ascii;
164
164
    myCurrentKeyDown.keycode = key;
165
165
    myCurrentKeyDown.flags   = mod;
 
166
    myCurrentKeyDown.ascii   = ascii;
166
167
    myKeyRepeatTime = myTime + kRepeatInitialDelay;
167
168
 
168
 
    activeDialog->handleKeyDown(ascii, key, mod);
 
169
    activeDialog->handleKeyDown(key, mod, ascii);
169
170
  }
170
171
  else
171
172
  {
172
 
    activeDialog->handleKeyUp(ascii, key, mod);
 
173
    activeDialog->handleKeyUp(key, mod, ascii);
173
174
 
174
175
    // Only stop firing events if it's the current key
175
176
    if (key == myCurrentKeyDown.keycode)
176
 
      myCurrentKeyDown.keycode = 0;
 
177
      myCurrentKeyDown.keycode = KBDK_UNKNOWN;
177
178
  }
178
179
}
179
180
 
338
339
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
339
340
void DialogContainer::reset()
340
341
{
341
 
  myCurrentKeyDown.keycode = 0;
 
342
  myCurrentKeyDown.keycode = KBDK_UNKNOWN;
342
343
  myCurrentMouseDown.button = -1;
343
344
  myLastClick.x = myLastClick.y = 0;
344
345
  myLastClick.time = 0;