The current event system and input handling makes the layer system impossible to maintain, as each layer can check input without considering the layers above it.
Instead a proper OnEvent system should be used that passes the events through the stack properly so that layers can mark them as handled and not be bypassed when they are.