It takes time to really hear the key of a song. Since you like to hum the melody, usually those notes are part of a major scale. So, if u can identify the melody notes with a particular major scale, you will most likely find your key.
Now, I know a lot of major scales contain many of the same notes, but there will usually be one scale that sticks out the most.
Just keep doing what you doing until you can hear the key by ear. Once u know the key, just hit one note on the keyboard and judge if that key u just pressed is higher or lower than the key of the song. Then, zero in on the right key until u get it.