It depends on what you mean by 'clear data'. If you mean Factory Reset, all your personal data not backed up, including photos, would be lost. But a Factory Reset would not normally be necessary to fix a Keyboard problem. Tell us more about the problem you have.
Backing up your photos and other data would also be a good idea.
http://forums.androidcentral.com/showthread.php?t=499341