The traditional view holds that pterosaurs did not perch on branches, largely because they did not have an opposable digit. This is wrong. Pterosaurs had an opposable digit. It was just not like that of birds. Instead it was uniquely pterosaurian — working by extension, not flexion. Peters (2002, 2010) described how pedal digit 5 in basal pterosaurs acted like a universal wrench, extending while digits 1-4 flexed around a branch of any diameter (Fig. 1), thereby opposing the flexing digits (note the white arrows in the branch cross-section).
Pterosaur perching requires a bipedal capability
Pterosaurs could perch on horizontal branches — although not quite like birds. As in birds, the anterior toes were located below the center of balance in flight, the shoulder glenoid, so a bipedal configuration was possible without shifting or lifting the torso.
In the most primitive pterosaurs pedal 5.2 (actually a fused p5.2+p5.3) was straight. In Dorygnathus and certain other derived clades, pedal 5.2 was bent or bowed in various ways (Peters 2011). Bent or straight had little effect on the universal wrench.
Certain derived pterosaurs without a large pedal digit 5 (e.g. ctenochasmatids, pterodactylids) probably did not perch on tree branches. Footprints indicate they were beachcombers. Only those with large fingers and trenchant finger claws could also have found safe haven on tree trunks, upon which pedal digit 5 had less of an importance.
Peters D 2002. A New Model for the Evolution of the Pterosaur Wing – with a twist. – Historical Biology 15: 277–301.
Peters D 2010. In defence of parallel interphalangeal lines. Historical Biology iFirst article, 2010, 1–6 DOI: 10.1080/08912961003663500