Possible crisis:
you're using a laptop at school. that's not the problem.
you're typing a project on the laptop. that's not the problem.
you lean over to help your neighbor with spelling. not the problem. (although sometimes you can get in trouble for that)
while you were leaning over a key popped off the laptop. could be a problem.
you toss the loose key on the floor. ooooh bad idea.
you try to conceal the key behind the table leg on the floor. ok.
you log off the laptop and put it away. um
you head out to your next class. the guilt isn't too bad.
attention... here comes the problem.
the next kid wants to use the laptop you had but it's missing a key. that kid tells the teacher. the teacher investigates and discovers YOU had the laptop last period.
teacher calls you from Spanish class to come to the library where the laptop sits without a key. you walk really slowly thinking about your lie.
The best course of action here is to tell on yourself. I'm not kidding. The teacher is only going to get angrier the more you lie. You're caught. Take your punishment quietly. Say you're sorry for breaking the key. Say you should have told on yourself right away. Say you're sorry for trying to hide the broken piece. Say that you just got really worried and kind of panicked. Look sorry. a tiny tear in the corner of your eye would be good.
If you decide not to tell on yourself but go with the lies then the problem will just grow and the punishment will grow, too. Your principal will be notified that you damaged expensive school property. Your parents will be notified that they have a large computer repair bill. You may lose computer privileges at school. This can get way bigger that you want it to.
People mess up. We learn to take the consequences and don't mess up that way again. usually.