Hallo duuh,

if (sw == 32) // dezimal
wäre richtig, oder
if (sw == 0x20) // hexadezimal

Gruß m.a.r.v.i.n