Fixed bug #233916: Centermap shortcut conflicts with death coil command.
This commit is contained in:
parent
5bc86cfbf6
commit
3bd4f43244
6 changed files with 27 additions and 20 deletions
src
|
@ -286,8 +286,8 @@ extern void DrawButtonPanel(void);
|
|||
extern void UpdateButtonPanel(void);
|
||||
/// FIXME: more docu
|
||||
extern void DoButtonButtonClicked(int button);
|
||||
/// FIXME: more docu
|
||||
extern void DoButtonPanelKey(int key);
|
||||
/// Lookup key for bottom panel buttons.
|
||||
extern int DoButtonPanelKey(int key);
|
||||
|
||||
//@}
|
||||
|
||||
|
|
|
@ -159,6 +159,13 @@ local int CommandKey(int key)
|
|||
}
|
||||
break;
|
||||
|
||||
case KeyCodeF1:
|
||||
case KeyCodeF2:
|
||||
case KeyCodeF3:
|
||||
case KeyCodeF4: // Set/Goto place
|
||||
DebugLevel0("FIXME: not written\n");
|
||||
break;
|
||||
|
||||
case KeyCodeF10:
|
||||
GamePaused=1;
|
||||
SetStatusLine("Game Paused");
|
||||
|
@ -400,6 +407,9 @@ global int HandleKeyDown(int key)
|
|||
case IfaceStateNormal: // Normal Game state
|
||||
switch( KeyState ) {
|
||||
case KeyStateCommand:
|
||||
if( DoButtonPanelKey(key) ) {
|
||||
return 1;
|
||||
}
|
||||
return CommandKey(key);
|
||||
case KeyStateInput:
|
||||
return InputKey(key);
|
||||
|
|
|
@ -847,26 +847,29 @@ global void DoButtonButtonClicked(int button)
|
|||
** Lookup key for bottom panel buttons.
|
||||
**
|
||||
** @param key Internal key symbol for pressed key.
|
||||
**
|
||||
** @returns True, if button is handled (consumed).
|
||||
*/
|
||||
global void DoButtonPanelKey(int key)
|
||||
global int DoButtonPanelKey(int key)
|
||||
{
|
||||
int i;
|
||||
|
||||
if( !CurrentButtons ) { // no buttons
|
||||
return;
|
||||
}
|
||||
if( CurrentButtons ) { // buttons
|
||||
|
||||
// cade: this is required for action queues SHIFT+M should be `m'
|
||||
if ( key >= 'A' && key <= 'Z' ) {
|
||||
key = tolower(key);
|
||||
}
|
||||
// cade: this is required for action queues SHIFT+M should be `m'
|
||||
if ( key >= 'A' && key <= 'Z' ) {
|
||||
key = tolower(key);
|
||||
}
|
||||
|
||||
for( i=0; i<9; ++i ) {
|
||||
if( CurrentButtons[i].Pos!=-1 && key==CurrentButtons[i].Key ) {
|
||||
DoButtonButtonClicked(i);
|
||||
return;
|
||||
for( i=0; i<9; ++i ) {
|
||||
if( CurrentButtons[i].Pos!=-1 && key==CurrentButtons[i].Key ) {
|
||||
DoButtonButtonClicked(i);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//@}
|
||||
|
|
|
@ -549,8 +549,6 @@ local void X11HandleKey(KeySym code)
|
|||
if( HandleKeyDown(icode) ) {
|
||||
return;
|
||||
}
|
||||
// FIXME: Should come first
|
||||
DoButtonPanelKey(icode);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -439,8 +439,6 @@ local void SdlHandleKey(const SDL_keysym* code)
|
|||
if( HandleKeyDown(icode) ) {
|
||||
return;
|
||||
}
|
||||
// FIXME: Should come first, move this into low level!!!!
|
||||
DoButtonPanelKey(icode);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -650,8 +650,6 @@ local void KeyboardEvent(int scancode, int press) {
|
|||
if(HandleKeyDown(icode)) {
|
||||
return;
|
||||
}
|
||||
// FIXME: Should come first
|
||||
DoButtonPanelKey(icode);
|
||||
} else if(press == KEY_EVENTRELEASE) {
|
||||
// FIXME: combine scancode -> internal keycode of press and release
|
||||
switch(scancode) {
|
||||
|
|
Loading…
Add table
Reference in a new issue