Iqqesh (עִקֵּשׁ) describes moral crookedness or perverseness — the twisted character of one who departs from righteous paths. It appears about 11 times in the Old Testament, mainly in Psalms and Proverbs. The root idea is of something physically bent or twisted applied to moral character.
Proverbs uses iqqesh as the antithesis of yashar (upright/straight). The perverse person is the foil to the righteous throughout wisdom literature: Proverbs 2:15 describes the wicked as 'whose ways are crooked'; Proverbs 22:5 warns that 'snares are in the way of the perverse.' Psalm 18:26 contains the important principle: 'with the crooked [iqqesh] you show yourself shrewd/twisted' — God deals with people according to their moral orientation. Crooked lives produce crooked outcomes. This is not divine revenge but moral realism: the shape of your heart determines what you encounter.