Monthly Archives: December 2009

Fix loud or stiff space-bar Microsoft Ergonomic Keyboard 4000

The Microsoft Natural Ergonomic Keyboard 4000 is an excellent product, no other keyboard really comes close to it for touch typing in my opinion.

However there can be one very annoying bit – the spacebar.  It can be excessively loud and/or stiff to press.  Fortunately though you can easily fix it yourself!


The problem is that the bottom of the plastic space bar connects with some plastic on the keyboard base.  To fix this you’ll want to add some cushioning to the base of the keyboard which you’ll find easy to do yourself.

First of all, you need to pull the spacebar off the keyboard, which is easiest if you pull from the top.  You’ll need to use a bit of force, though don’t worry your keyboard will be ok :-).  Once the space bar is off you can put in your cushioning.  The image below shows where you’ll be attaching your cushions.


I made my cushions from inexpensive heat-shrink tubing filled with some cotton wool and attached it to the keyboard with some double-sided tape, though you could easily substitute this with whatever else you have around, just as long as it is nice and squishy.  The image below show what it should it looks likes with one of the cushions.


Once the cushioning is in, remount the space bar and you should be good to go!


The space-bar can sometimes be stiff to press, particularly on its side-edges.  The stiffness will usually go away after a period of normal use, though you can speed this natural process up a bit by simply tapping it a couple of thousand times where your thumbs normally press it.  For me this spot is underneath the ‘V’ key on the left and about halfway across the ‘N’ key on the right.  Just sit there and tap these spots really fast for several minutes.  You can also try pressing with very little pressure in order to get the key to stick, and then apply more pressure so that it rubs really hard inside the keyboard.  Press on the top corners of the space bar to get even more resistance.

If this doesn’t work, this you’ve basically got a dud that will only frustrate you, so return it to the shop and get another one!

Perl in_array()

Perl can use the grep function as the equivalent of PHP’s in_array() function.  Essentially

$found = grep $_ eq $my_value, @my_array

Note, the grep() function is world unto its own, it can do quite a bit more than just this.  $found is actually $my_value if it finds it, which tends to evaluate to ‘True’ in Perl.

Python sprintf()

Python uses the % operator to do a sprintf() function.

“The %s brown %s” % (“quick”, “fox”)

Brackets can be omitted if there for single arguments

“The %s brown fox” % “fast”

You can view more PHP-Python statements here.

Python error/exception handling

This code quickly shows how to do basic error handling in python

  # None + 1
  raise ZeroDivisionError
except ZeroDivisionError:
  print 'You cannot divide by zero!'
  print sys.exc_info()[0]
 print 'No errors raised'
 print 'Run Clean up actions'