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 7521701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T02:18:12+00:00 2026-05-30T02:18:12+00:00

The spacebar has a default action on many UI fields: click for buttonfield, select/unselect

  • 0

The spacebar has a default action on many UI fields: click for buttonfield, select/unselect for checkbox, scrolling on a verticalfieldmanager.

My screen has a listfield with more than 20 rows. When the user hits the spacebar, I want the listfield to scroll.

For example, BlackBerry default calendar app, when we hit spacebar, it will scroll down.
and BlackBerry default text Messages, when we hit spacebar, it will scroll down.

is this a default property? or do I need to write code for spacebar key?

  • 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-05-30T02:18:13+00:00Added an answer on May 30, 2026 at 2:18 am

    You have to create a custom key listener:

    private class CustomKeyListener implements KeyListener {
    
        public boolean keyChar(char key, int status, int time) {
            if(key == Characters.SPACE){
                //TODO handle key here
                //WARNING: this code runs on event thread!
                return true;
            } 
    
            return false;
        }
    
        public boolean keyDown(int keycode, int time) {         
            return false;
        }
    
        public boolean keyRepeat(int keycode, int time) {
            return false;
        }
    
        public boolean keyStatus(int keycode, int time) {
            return false;
        }
    
        public boolean keyUp(int keycode, int time) {
            return false;
        }       
    }
    

    Then call Mainscreen.addKeyListener with an instance of your key listener as parameter.

    From there you can change your manager (main manager or nested one) scroll with the Manager.setVerticalScroll method. If you want to increment it, you can retrieve the current scroll calling Manager.getVerticalScroll and then add a fixed value. In case you don’t have a nested VerticalFieldManager in your screen, you can try with your screen’s default, which you can obtain calling Mainscreen.getMainManager.

    UPDATE:
    For List fields, you can call ListField.getSelectedIndex and ListField.setSelectedIndex to change elements, but this is not an smooth scrolling. But if you placed the list field inside a VerticalFieldManager, you can change the manager scroll as described above.

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

Sidebar

Related Questions

By default, if you tap the spacebar twice on the iPhone or iPad, instead
Possible Duplicate: Space bar not working in form fields Has anyone run into an
It looks like in most browsers, an <input type=submit> treats both [spacebar] and [enter]
How can I have an accessible read only checkbox in Silverlight? The accessibility requirements
I have a pong type of game and I want the spacebar to pause
I'm trying to identify if the user has typed someone else's username if the
Context: I have a data grid where the following has been implemented. tabbing through
I'm trying to fire an event on spacebar press if an url is found
jQuery mobile, while amazing in many ways, tends to be frustrating at times. In
when a user clicks the spacebar or backspace I need to create a variable

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.