We introduce a notion of the twist of an isometry of the hyperbolic plane. This twist function is defined on the universal covering group of orientation-preserving isometries of the hyperbolic plane, at each point in the plane. We relate this function to a function defined by Milnor and generalised by Wood. We deduce various properties of the twist function, and use it to give new proofs of several well-known results, including the Milnor--Wood inequality, using purely hyperbolic-geometric methods. Our methods express inequalities in Milnor's function as equalities, with the deficiency from equality given by an area in the hyperbolic plane. We find that the twist of certain products found in surface group presentations is equal to the area of certain hyperbolic polygons arising as their fundamental domains.