I have a gun safe by the bed with a keyless lock-- five buttons, three keypresses opens it. While the kids were young, I felt that was necessary. That was not my main line of defense against the kids misusing firearms. Nor was it that I kept to strict NRA guidelines and kept my firearms and ammo segregated and under seperate locks. Honestly, I don't believe locks can stop a kid. Properly motivated, a kid will defeat a lock.
My main defense against my children misusing firearms was familiarity. From about age 2, my kids were regularly shown pistols, rifles, shotguns and whatever else I had around the house. They could touch them and hold them, just as I was allowed starting at age 4. I told my kids that anytime they wanted access to the firearms, all they needed to do was ask. They only needed a parent's supervision. They also had free access to the ammunition on request. They just could not have both at the same time.
Kids are intrigued by firearms. As long as there is mystery, they want to explore. If you remove the mystery, they get bored with the idea very quickly. I think that with three sons and close to 20 years, I have had a total of three requests to handle firearms. I quickly complied. They touched it, held it, got bored and gave it back. When you look at it from a kid's point of view, firearms are big heavy things that have all the charm of a claw hammer. A little exposure goes a long way.
They also got to use them when they were ready to do so. They knew what firearms were meant to do. They knew what could go wrong. Although two of my kids have had a great interest in firearms their whole lives, they have had zero interest in spurious or un-attended handling of firearms. One of the three dislikes firearms completely and wants nothing to do with them.