// Less than operator must be defined to use with std::map.
inlinebooloperator<(constShortcut&sc)const
{
// Compare win key first
if(winKey<sc.winKey)
{
returntrue;
}
elseif(winKey>sc.winKey)
{
returnfalse;
}
else
{
// If win key is equal, then compare ctrl key
if(ctrlKey<sc.ctrlKey)
{
returntrue;
}
elseif(ctrlKey>sc.ctrlKey)
{
returnfalse;
}
else
{
// If ctrl key is equal, then compare alt key
if(altKey<sc.altKey)
{
returntrue;
}
elseif(altKey>sc.altKey)
{
returnfalse;
}
else
{
// If alt key is equal, then compare shift key
if(shiftKey<sc.shiftKey)
{
returntrue;
}
elseif(shiftKey>sc.shiftKey)
{
returnfalse;
}
else
{
// If shift key is equal, then compare action key
if(actionKey<sc.actionKey)
{
returntrue;
}
else
{
returnfalse;
}
}
}
}
}
}
// Function to return the number of keys in the shortcut
intSize()const;
// Function to return true if the shortcut has no keys set
boolIsEmpty()const;
// Function to reset all the keys in the shortcut
voidReset();
// Function to return true if the shortcut is valid. A valid shortcut has atleast one modifier, as well as an action key
boolIsValidShortcut()const;
// Function to return the action key
DWORDGetActionKey()const;
// Function to return the virtual key code of the win key state expected in the shortcut. Argument is used to decide which win key to return in case of both. If the current shortcut doesn't use both win keys then arg is ignored. Return NULL if it is not a part of the shortcut
DWORDGetWinKey(constModifierKey&input)const;
// Function to return the virtual key code of the ctrl key state expected in the shortcut. Return NULL if it is not a part of the shortcut
DWORDGetCtrlKey()const;
// Function to return the virtual key code of the alt key state expected in the shortcut. Return NULL if it is not a part of the shortcut
DWORDGetAltKey()const;
// Function to return the virtual key code of the shift key state expected in the shortcut. Return NULL if it is not a part of the shortcut
DWORDGetShiftKey()const;
// Function to check if the input key matches the win key expected in the shortcut
boolCheckWinKey(constDWORD&input)const;
// Function to check if the input key matches the ctrl key expected in the shortcut
boolCheckCtrlKey(constDWORD&input)const;
// Function to check if the input key matches the alt key expected in the shortcut
boolCheckAltKey(constDWORD&input)const;
// Function to check if the input key matches the shift key expected in the shortcut
boolCheckShiftKey(constDWORD&input)const;
// Function to set a key in the shortcut based on the passed key code argument. Since there is no VK_WIN code, use the second argument for setting common win key. If isWinBoth is true then first arg is ignored. Returns false if it is already set to the same value. This can be used to avoid UI refreshing
// Function to reset the state of a shortcut key based on the passed key code argument. Since there is no VK_WIN code, use the second argument for setting common win key.