Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8834045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:55:29+00:00 2026-06-14T08:55:29+00:00

Possible Duplicate: How can I detect if an external keyboard is present on an

  • 0

Possible Duplicate:
How can I detect if an external keyboard is present on an iPad?

When a user begins editing a textfield in my iPhone app’s UI, I want to use the space between the textfield and the keyboard for a list of related options.

Using the regular (on-screen) keyboard from iOS, there are a couple of convenient notifications to listen to, that help me decide how much space I have left for the list in between.

However when you attach (or simulate the use of) a hardware keyboard, these notifications are not posted anymore. Not too unexpected, but this leaves me with a bit of a challenge. If the user uses the hardware keyboard, I have more space for the list.

But how can I determine whether the user has a hardware keyboard or not, if there’s no triggered notification or delegate method to listen to? Or is there?

What’s also to be considered is that a user can first use the app with the software keyboard and then attach his/her hardware keyboard and continue working with the app. At that point, the software keyboard will hide, but the user is still editing the textfield.

I found one old dupe for this question, but it is unanswered:

  • How do I detect that a hardware keyboard is attached to an iPhone?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T08:55:29+00:00Added an answer on June 14, 2026 at 8:55 am

    Input accessory views are shown at the bottom of the screen if there’s a hardware keyboard attached (otherwise they’re attached to the top of the on-screen keyboard).

    Set the accessory view of your input view to an empty UIView of size CGRectZero. You will receive the show / hide notifications for both cases, and be able to determine the available screen size from the metrics in the notification’s userinfo dictionary.

    UIView *inputAccessoryView = [[[UIView alloc] initWithFrame:CGRectZero] autorelease];
    inputAccessoryView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
    textView.inputAccessoryView = inputAccessoryView;
    
    …
    
    - (void)keyboardWillShow:(NSNotification*)aNotification {
      NSLog(@"%@", [aNotification userInfo]);
    }
    

    Logged metrics – note the frame in UIKeyboardFrameEndUserInfoKey is off screen

    // (NSDictionary *) {
    //     UIKeyboardAnimationCurveUserInfoKey = 0;
    //     UIKeyboardAnimationDurationUserInfoKey = "0.25";
    //     UIKeyboardBoundsUserInfoKey = "NSRect: {{0, 0}, {768, 264}}";
    //     UIKeyboardCenterBeginUserInfoKey = "NSPoint: {384, 891}";
    //     UIKeyboardCenterEndUserInfoKey = "NSPoint: {384, 1155}";
    //     UIKeyboardFrameBeginUserInfoKey = "NSRect: {{0, 758}, {768, 264}}";
    //     UIKeyboardFrameChangedByUserInteraction = 0;
    //     UIKeyboardFrameEndUserInfoKey = "NSRect: {{0, 1022}, {768, 264}}";
    // }
    

    Update – very similar to user721239’s answer in the related question.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: How to detect iPhone 5 (widescreen devices)? We can differentiate iPad and
Possible Duplicate: How can I locally detect iPhone clock advancement by a user between
Possible Duplicate: Best way to programmatically detect iPad/iPhone hardware How can I differentiate the
Possible Duplicate: iPad Web App: Detect Virtual Keyboard Using JavaScript in Safari? I'm building
Possible Duplicate: How can I detect the browser with PHP or JavaScript? I want
Possible Duplicate: How can my android app detect a dropped call? Detecting outgoing call
Possible Duplicate: How can I detect if caps lock is toggled in Swing? How
Possible Duplicate: How to detect a USB device has been plugged in? I want
Possible Duplicate: Browser detection in javascript? I was wondering how can I detect IE
Possible Duplicate: Detect if an outgoing call has been answered How can I know

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.