do not assign one key twice to the same button
git-svn-id: https://svn.code.sf.net/p/vbam/code/trunk@153 a31d4220-a93d-0410-bf67-fe4944624d44
This commit is contained in:
parent
aa49ab74ff
commit
62a08c4997
|
@ -35,8 +35,20 @@ BOOL bAppendMode;
|
||||||
|
|
||||||
void AssignKey(KeyList &Key, int Out)
|
void AssignKey(KeyList &Key, int Out)
|
||||||
{
|
{
|
||||||
if (!bAppendMode)
|
if( !bAppendMode ) {
|
||||||
Key.RemoveAll();
|
Key.RemoveAll();
|
||||||
|
} else {
|
||||||
|
POSITION pos = Key.GetHeadPosition();
|
||||||
|
if( pos != NULL ) {
|
||||||
|
// the list is not empty
|
||||||
|
while( true ) {
|
||||||
|
// we don't want to assign the same key twice
|
||||||
|
if( Key.GetAt( pos ) == Out ) return;
|
||||||
|
if( pos == Key.GetTailPosition() ) break;
|
||||||
|
Key.GetNext( pos );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Key.AddTail(Out);
|
Key.AddTail(Out);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue