The volume dial is implemented using the "media keys," which are a bunch of keyboard scancodes that were allocated for doing weird things like adjusting volume, playing audio CDs, and launching default applications. Because they were shoe-horned in, some applications will read these special codes as keys in the normal range and respond however they see fit.