Update to key map algorithm, added shifting both righht and left and file detection