most likely low on freon. while driving the ac compressor spins faster so it might cool better with low freon at higher engine rpm. have your system charged and checked for leaks.
My 2000 V6 Sonata shakes while at idle also. I discovered I need an oxegen sensor and more importantly an "Idle Air Control Valve". 239.00 is the average and hard to find. .
Because the engine is running. Shut it off or give it gas and it will not idle.
Possible cylinder misfire and/or failing engine mounts.
below the throttle body... once you remove the intake hose, you will see it from the idle electrical plug
I have a 2000 sonata and I had the same problem. You may want to check the IAC and or clean the throttle body.
From my experience, If your crank sensors bad the car will not start up at all.
Hyundai accent idle speed
It is just next to the TPS (Throttle Position Sensor) on the intake manifold.
You may have leak in the intake
it seems there a small screw back of the intake but the idle is control by the ecu.
This is a symptom of the water pump not working properly or your idle speed is set too low thus not circulating enough water.
its on the lower passenger side of the engine block