You need treat the horizontal and vertical completely separately.
Vertical:
What you want to use is acceleration (due to gravity). You should have variables for:
the height position of the player object
the vertical velocity of the player object
the acceleration due to gravity
e.g.
y=height pos
v=velocity
g=gravity
h=ground height
do
if y=>h
v=0
else
v=v+a
endif
y=y+v
if shiftkey() then v=-15
loop
Horizontal:
You must use air resistance (this is actually that hard)
when player is not pressing left or right, horizontal velocity is multiplied by 0.95 (or something else less than 1.0 depending on how much resistance you want - The lower the number, the more you'll decelerate).