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

  • SEARCH
  • Home
  • 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 8528155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T08:44:24+00:00 2026-06-11T08:44:24+00:00

I don’t care about which key was pressed, or how long, or anything like

  • 0

I don’t care about which key was pressed, or how long, or anything like that. All I need is a way to detect that the user has touched the screen, even if that happens to be on the part of the screen covered by a keyboard.

My goal here is to detect a lack of interaction to ‘reset’ the app to a default state if left along long enough — think a ‘kiosk mode’ application. The issue is that I can’t detect when the keyboard is touched, as the keyboard apparently intercepts all touch events, even before my customer window can handle them.

Edit:

Considered (and dismissed) is the use of just keyboard show and hide notifications — we need to prolong screen display if the user is actively typing. Since we use UIWebViews to display certain things, we also can’t use the delegate methods of UITextViews or UITextFields.

  • 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-11T08:44:25+00:00Added an answer on June 11, 2026 at 8:44 am

    It sounds like detecting all touches—on the keyboard and elsewhere—would suffice. We can do that by subclassing UIApplication to override sendEvent:.

    We’ll extend the UIApplicationDelegate protocol with a new message, application:willSendTouchEvent:, and we’ll make our UIApplication subclass send the message to its delegate before handling any touch event.

    MyApplication.h

    @interface MyApplication : UIApplication
    @end
    
    @protocol MyApplicationDelegate <UIApplicationDelegate>
    - (void)application:(MyApplication *)application willSendTouchEvent:(UIEvent *)event;
    @end
    

    MyApplication.m

    @implementation MyApplication
    
    - (void)sendEvent:(UIEvent *)event {
        if (event.type == UIEventTypeTouches) {
            id<MyApplicationDelegate> delegate = (id<MyApplicationDelegate>)self.delegate;
            [delegate application:self willSendTouchEvent:event];
        }
        [super sendEvent:event];
    }
    
    @end
    

    We’ll need to make our app delegate conform to the MyApplicationDelegate protocol:

    AppDelegate.h

    #import "MyApplication.h"
    
    @interface AppDelegate : UIResponder <MyApplicationDelegate>
    // ...
    

    AppDelegate.m

    @implementation AppDelegate
    
    - (void)application:(MyApplication *)application willSendTouchEvent:(UIEvent *)event {
        NSLog(@"touch event: %@", event);
        // Reset your idle timer here.
    }
    

    Finally, we need to make the app use our new MyApplication class:

    main.m

    #import "AppDelegate.h"
    #import "MyApplication.h"
    
    int main(int argc, char *argv[])
    {
        @autoreleasepool {
            return UIApplicationMain(argc, argv,
                NSStringFromClass([MyApplication class]),
                NSStringFromClass([AppDelegate class]));
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

don't know if the title describes anything about what I'm trying to say but
(Don't care about the version. IE or not IE.)
Don't need to do this right now but thinking about the future... What would
Don't know if there is a better way to do this, so that is
Don't know if it matters, but the msg.d is about 300 rows long. I
don't know what happened in my jcrop selection. I think I pressed some keys
Don't know how to google for such, but is there a way to query
Don't ask me why but I need to do the following: string ClassName =
Don't think that I'm mad, I understand how php works! That being said. I
I've got a string that has curly quotes in it. I'd like to replace

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.