shouldPop method
Returns true if the given msg should trigger a pop action
based on this configuration.
Implementation
bool shouldPop(KeyMsg msg) {
final key = msg.key;
if (escapeEnabled && key.type == KeyType.escape) return true;
if (backspaceEnabled && key.type == KeyType.backspace) return true;
if (customPopKey != null &&
key.type == KeyType.runes &&
key.runes.isNotEmpty &&
String.fromCharCodes(key.runes) == customPopKey) {
return true;
}
return false;
}