Note that there are some explanatory texts on larger screens.

plurals
  1. POHide device keyboard inside keyboardWillShow notification based on some condition for iPad
    primarykey
    data
    text
    <p>I am working on an iPad application which uses <code>Motorola CS3070 bar code scanner</code>. I am connecting the scanner as using HID Profile and it is treated as a bluetooth keyboard by iPad. When scanner is connected to iPad using bluetooth and if we focus on any <code>textfield</code> inside application, it won't open device virtual keyboard. This is expected as device treats bar code scanner as <code>bluetooth keyboard</code>.</p> <p>While doing scanning if the scanner is disconnected, device virtual keyboard will be displayed. When this happens we want to show an alert instead of having keyboard displayed on the screen. We are using <code>keyboardWillShow</code> notification to differentiate whether device virtual keyboard is displayed or not. Inside <code>keyboardWillShow</code> we tried hiding the keyboard. This works when we disconnect the scanner and then select a text field. But this is not working when the focus was already in a <code>textfield</code> and device connects to bluetooth keyboard and if we disconnect the bluetooth. We see keyboard device virtual keyboard getting displayed in that case. I checked the code inside the <code>keyboardWillShow</code> and it is getting executed both the times. Also when it is not working, the keyboard which gets displayed on screen is not responding when we click on any keys.</p> <p>Please let me know if we can hide keyboard when it switches between bluetooth keyboard to device virtual keyboard.</p> <p>Please see below code in keyboardWillShow,</p> <pre><code>-(void) keyboardWillShow: (NSNotification *) theNotification { Global *obj=[Global getInstance]; if (obj.selectedStartScan == true) { UITextField *theTextField = [theNotification object]; //[theTextField resignFirstResponder]; UIAlertView *errorAlert = [[UIAlertView alloc] initWithTitle:@"Error" message:@"Scanner is not Connected" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; [self.window.rootViewController.view endEditing:YES]; NSLog(@"inside if obj.selectedStartScan :........."); [errorAlert show]; } } </code></pre> <p>Thanks in advance.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload