The coil of the proposed electromagnet will tend to oppose any change in current through itself, as is the behavior of any inductor.
To reduce the time taken to switch between magnetization profiles, here are some points to keep in mind:
- Use a higher voltage drive, with current limiting. This way, a higher potential difference across the ends of the coil forces the current to change more rapidly, and once the desired current (and hence the desired magnetic field) is achieved, the current limiter prevents the coil from overheating. This method is widely used in stepper motor drivers, for instance, to cause steps to be faster, while not exceeding the coil current ratings. The term "chopper driver" would yield suitable search results.
- Use the smallest possible magnetic core (soft iron or whatever material is chosen), and use a lower resistance coil so that the bulk of the magnetic field is due to the coil. The bigger the core, the longer a magnetic field established in it will take to collapse. Equivalently, the longer it will take to build up sufficient magnetic field strength in the assembly. Think of it as magnetic "inertia", similar to how a larger mass takes longer (or more energy) to get moving, or to bring to a halt. The downside is, this will mean higher current consumption by the coil.
The problem remains, though, that there needs to be a method of sensing when the button is pushed past the inflection point, to determine when the magnetic field needs to be collapsed (a fast diode, as mentioned in another answer) or reversed. A fair bit of sensing and computing will go into each button for this purpose alone.
An innovative physical arrangement could simplify this and be used to provide the button-press experience described:
Instead of two opposing magnetic poles face to face, with the electromagnet opposing the magnet on the button, consider the following:
The rectangular magnets on two sides of the button's movement path are electromagnets, so the field strength can be controlled. The round permanent magnet fitted on the button has polarity reverse to the electromagnets, i.e. the North face is downward in this example.
The button would thus face a strong resistance even up to the point when the magnet is aligned to the electromagnets. As soon as the button pushes past that, the magnetic opposition is in the opposite direction, i.e. pushing the button downward against the spring below. When the button is released, and the electromagnet power removed, the spring pushes the button past the electromagnets, to the upper equilibrium position.
By varying the electromagnetic strength, the springiness before the inflection point can be varied, and this does not need any form of sensing of the button position relative to the electromagnets.