How to calculate how much compression is needed for a spring to buckle

First off; School was many years ago and I know little of the mathematics behind all the physics and engineering stuff. So if you have an answer, please explain it like I'm 5?

The goal: I aim to be able to create a buckling spring switch (like the old IBM keyboards) compacted into any form factor that the calculations might allow.

The problem: How can I calculate which spring I should use to produce the buckle?

My research so far: So I've found out about the slenderness ratio of springs. If I make sure that the free part of the spring has a mean ration of above 4 the spring will likely buckle. But how do I know how much compression I will need for the buckle to occur? Meaning; Given spring X, how many millimeters of compression will be needed for the spring to buckle?
My search-skills does not serve me well here.

To iterate: I want the spring to buckle. If you know about the IBM Model M (and the like) you probably know what I want to be able to do.