but in Keypad examples it is initialized before setup() too. so what problems?
where do you call _keypad.begin()? it should be in keyblock.init(), which should be called in box.setup().
btw Arduino recommends the name begin(), you have init() and setup()