Hello ahsan261,
Thanks for reaching out to us in Apple Support Communities about your iPhone getting warm. We're happy to help by looking into this more!
Here's a resource that can help: If your iPhone, iPad, or iPod touch gets too hot or too cold
You might notice that your device feels warmer when you:
• Set up your device the first time
• Restore from a backup
• Wirelessly charge your device
• Use graphics-intensive or processor-intensive apps, games, or features, including augmented-reality apps
• Stream high-quality video
These conditions are normal, and your device will return to a regular temperature when the process is complete or when you finish your activity. If your device doesn't display a temperature warning, you can keep using your device.
With regard to your keyboard getting stuck, do you notice that this happens in particular applications or does it happens in all applications? What do you do to get it unstuck?
Hope this helps.
Best Regards.