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

« back to all changes in this revision

Viewing changes to src/debugger/gui/RomListWidget.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: RomListWidget.cxx 2199 2011-01-01 16:04:32Z stephena $
 
17
// $Id: RomListWidget.cxx 2356 2012-01-14 22:00:54Z stephena $
18
18
//
19
19
//   Based on code from ScummVM - Scumm Interpreter
20
20
//   Copyright (C) 2002-2004 The ScummVM project
38
38
    _currentPos(0),
39
39
    _selectedItem(-1),
40
40
    _highlightedItem(-1),
41
 
    _currentKeyDown(0),
42
 
    _editMode(false)
 
41
    _editMode(false),
 
42
    _currentKeyDown(KBDK_UNKNOWN)
43
43
{
44
44
  _flags = WIDGET_ENABLED | WIDGET_CLEARBG | WIDGET_RETAIN_FOCUS;
45
45
  _type = kRomListWidget;
284
284
}
285
285
 
286
286
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
287
 
bool RomListWidget::handleKeyDown(int ascii, int keycode, int modifiers)
 
287
bool RomListWidget::handleKeyDown(StellaKey key, StellaMod mod, char ascii)
288
288
{
289
289
  // Ignore all Alt-mod keys
290
 
  if(instance().eventHandler().kbdAlt(modifiers))
 
290
  if(instance().eventHandler().kbdAlt(mod))
291
291
    return true;
292
292
 
293
293
  bool handled = true;
296
296
  if (_editMode)
297
297
  {
298
298
    // Class EditableWidget handles all text editing related key presses for us
299
 
    handled = EditableWidget::handleKeyDown(ascii, keycode, modifiers);
 
299
    handled = EditableWidget::handleKeyDown(key, mod, ascii);
300
300
  }
301
301
  else
302
302
  {
303
303
    // not editmode
304
 
    switch (keycode)
 
304
    switch (key)
305
305
    {
306
 
      case ' ':  // space
 
306
      case KBDK_SPACE:
307
307
        // Snap list back to currently highlighted line
308
308
        if(_highlightedItem >= 0)
309
309
        {
323
323
    scrollToSelected();
324
324
  }
325
325
 
326
 
  _currentKeyDown = keycode;
 
326
  _currentKeyDown = key;
327
327
  return handled;
328
328
}
329
329
 
330
330
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
331
 
bool RomListWidget::handleKeyUp(int ascii, int keycode, int modifiers)
 
331
bool RomListWidget::handleKeyUp(StellaKey key, StellaMod mod, char ascii)
332
332
{
333
 
  if (keycode == _currentKeyDown)
334
 
    _currentKeyDown = 0;
 
333
  if (key == _currentKeyDown)
 
334
    _currentKeyDown = KBDK_UNKNOWN;
335
335
  return true;
336
336
}
337
337