The widget TVBgone does this function: it loops sending all poweroff signals, but I don't think it's possible to check which keyset worked because in any case there is no IR receiver on n900...