×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    May 2010
    Posts
    3

    Tactile Feedback no Working on N97mini

    I want to implement tactile feedback on my widget on a click event. Nothing that I try works. Bellow a simple widget I did that should be working and it is not.

    index.html
    HTML Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    	<head>
    		<title> Sample Widget</title>
    		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    		<script language="javascript" type="text/javascript" src="jquery.js"></script>
    		<script language="javascript" type="text/javascript" src="basic.js"></script>
        	<link rel="stylesheet" href="basic.css" type="text/css">
        	<META NAME="Generator" CONTENT="Nokia WRT plug-in for Aptana Studio 2.0.0" />
    	</head>
    	<body onLoad="javascript:init();">
    		<embed id="sysinfo" type="application/x-systeminfo-widget" hidden="yes"/>
            
            <input id="time" value="100" />
            <input id="vibra" value="100" />
    		
    		<div id="element_1" feedback="100" style="width: 200px; height: 100px; background: red;"></div>
    		
    		<div id="element_2"  feedback="50" style="width: 200px; height: 100px; background: green;"></div>
    		
    		<div id="element_3" style="width: 200px; height: 100px; background: blue;"></div>
    	</body>
    </html>
    basic.js
    Code:
    function init()
    {
    	document.addEventListener('click', tactileFeedback, false);
    }
    
    function tactileFeedback(event)
    {
    	var target = event.target;
    	
    	var feedback = target.attributes.feedback;
    
    	if(feedback)
    	{		
    		var sysinfo = document.embeds[0];
    		if (sysinfo && sysinfo.startvibra) {
    			var time = parseInt($('#time').val()); 
    			var vibra = parseInt($('#vibra').val());
    			sysinfo.startvibra(time, vibra);
    		}
    	}
    }



    I am deploying it on my N97mini.

    Any help or insight will be appreciated.

  2. #2
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,405

    Re: Tactile Feedback no Working on N97mini

    Hi,

    have you checked if vibration is turned on in the current profile, by using the sysinfo.vibrasettings property?

    Pit

  3. #3
    Registered User
    Join Date
    May 2010
    Posts
    3

    Re: Tactile Feedback no Working on N97mini

    Pit,

    Tks for your response.

    Just checked it. It returns 1 (Vibration setting in the user profile is on.)

    Here is the code I used:

    Code:
    	var sysinfo = document.embeds[0];
    	alert(sysinfo.vibrasettings);
    When I use (in some cases <a href... tag, it does vibrate. Also, I am using Guarana UI Accordion and it also does vibrate when I click on the accordion items to open and close it. So at the end of the day, it boils down to the code I have posted and it just won't work!!!!!!

    I have also check on the profiles menu on each profile. They are all set to vibrate...

    Any other clue would definetly help me.

  4. #4
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,405

    Re: Tactile Feedback no Working on N97mini

    Hi abernardo,

    just checked on my N97, and it doesn't vibrate as well.

    About Guarana UI, the reason why its click events cause vibrations should be that some HTML elements (specifically, <A> elements) have tactile feedback by default, so you don't need to code anything to add vibration to them: they just cause vibration once clicked. So you could think of using those A nodes to bypass your issue.

    Anyway, I'll let you know if I get any updates about this.

    Pit

Similar Threads

  1. Tactile feedback N97 not working
    By isydor in forum Symbian Web Runtime
    Replies: 3
    Last Post: 2010-05-22, 07:46
  2. Replies: 6
    Last Post: 2009-01-27, 08:40
  3. Replies: 2
    Last Post: 2008-12-20, 20:31
  4. How capture tactile feedback in console?
    By the3sky in forum Symbian User Interface
    Replies: 1
    Last Post: 2008-10-18, 09:17
  5. Vibetonz Tactile Feedback
    By netbsd37 in forum Symbian C++
    Replies: 1
    Last Post: 2007-08-03, 01:40

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •