A thiacalix[4]arene based fluorescent chemosensor 3 of 1,3-alternate conformation bearing two dansyl groups and a crown-5 ring behaves as an “On–Off” reversible switch for two chemical inputs Hg2+ and K+ ions and mimics a molecular level keypad lock in the presence of F− ions.