´ÙÀ½ À§·Î ÀÌÀü ¸ñÂ÷ ¸®´ª½º ÇÁ·Î±×·¡¸Ó¸¦ À§ÇÑ °¡À̵å

9.1 ¸¶¿ì½º ÇÁ·Î±×·¡¹Ö (Mouse programming)

¸¶¿ì½º´Â ½Ã¸®¾ó(serial) Æ÷Æ®¿¡ ¿¬°áµÇ°Å³ª Á÷Á¢ AT ¹ö½º¿¡ ¿¬°áµÇ¾îÁö°í ¸¶¿ì½ºÀÇ ´Ù¸¥ ŸÀÔµéÀº ¸¶¿ì½º ÇÁ·Î±×·¡¹ÖÀ» ´õ ¾î·Æ°Ô ¸¸µå´Â ´Ù¸¥ Á¾·ùÀÇ ÀڷḦ º¸³½´Ù. ±×·¯³ª, Andrew Haylett´Â Ä£ÀýÇÏ°Ôµµ ´ç½Å ÀÚ½ÅÀÇ ÇÁ·Î±×·¥¿¡ ±×ÀÇ ¸¶¿ì½º ·çƾ(routine)¸¦ »ç¿ëÇÒ ¼ö ÀÖµµ·Ï ±×ÀÇ selection ÇÁ·Î±×·¥¿¡ °ü´ëÇÑ ÀúÀÛ±ÇÀ» ºÎ¿©Çß´Ù. ÀÌ °¡À̵å(guide)¿¡ Æ÷ÇÔµÈ COPYRIGHT ÁÖÀǹ®À» °¡Áø selection-1.8ÀÇ pre-release¸¦ ãÀ» ¼ö ÀÖ´Ù. X11Àº ÀÌ¹Ì Æí¾ÈÇÑ ¸¶¿ì½º API¸¦ Á¦°øÇÔÀ¸·Î AndrewÀÇ ·çƾÀº non-X11 ÀÀ¿ëÇÁ·Î±×·¥¿¡¼­¸¸ »ç¿ëµÇ¾îÁø´Ù.
´ç½ÅÀº selection ÆÐÅ°Áö·Î ºÎÅÍ mouse.c¿Í mouse.h ¸ðµâµé¸¸ ÇÊ¿äÇÏ´Ù. ¸¶¿ì½º À̺¥Æ®¸¦ ¾ò±â À§ÇØ ±âº»ÀûÀ¸·Î ms_init()¿Í get_ms_event()¸¦ È£ÃâÇؾ߸¸ ÇÑ´Ù. ms_init´Â ´ÙÀ½ÀÇ 10°³ÀÇ ¾Æ±Ô¸ÕÆ®(argument)°¡ ÇÊ¿äÇÏ´Ù.:

  1. int acceleration
    Àº °¡¼ÓÈ­(acceleration) ¿ä¼Ò(factor)ÀÌ´Ù. delta Çȼ¿(pixel)º¸´Ù ´õ ¸¹ÀÌ ¸¶¿ì½º¸¦ ¿òÁ÷Àδٸé, ¿òÁ÷ÀÓÀº ÀÌ °ª¿¡ µû¶ó ´õ ºü¸£°Ô µÈ´Ù.
  2. int baud
    ¸¶¿ì½º¸¦ »ç¿ëÇÏ´Â bps ºñÀ²(rate)ÀÌ´Ù(ÀϹÝÀûÀ¸·Î 1200).
  3. int delta
    ÀÌ°ÍÀº °¡¼ÓÈ­(acceleration)¸¦ ½ÃÀÛÇϱâ Àü¿¡ ¸¶¿ì½º¸¦ ¿òÁ÷¿©¾ßÇÏ´Â Çȼ¿(pixel)ÀÇ ¼öÀÌ´Ù.
  4. char *device
    ¸¶¿ì½º ÀåÄ¡ÀÇ À̸§ÀÌ´Ù(¿¹, /dev/mouse)
  5. int toggle
    ´Â DTR,RTS ¶Ç´Â DTR°ú RTS ¸¶¿ì½º ¸ðµ© ¶óÀÎ(mouse modem lines)À» ¸ðµÎ¸¦ ÃʱâÈ­ °ªÀ¸·Î Åä±Û(toggle)ÇÑ´Ù(ÀϹÝÀûÀ¸·Î 0).
  6. int sample
    ¸¶¿ì½ºÀÇ ÇØ»óµµ(resolution)(dpi) (ÀϹÝÀûÀ¸·Î 100).
  7. mouse_type mouse
    ¸¶¿ì½º¿¡ ´ëÇØ P_MSC (Mouse Systems Corp.)ó·³ ¸¶¿ì½º¿Í ¿¬°áµÈ ½Äº°ÀÚ(identifier)
  8. int slack
    slackÀÌ -1À̸é È­¸éÀÇ °¡ÀåÀÚ¸® ³Ê¸Ó·Î ¸¶¿ì½º¸¦ À̵¿ÇÏ°íÀÚ ÇÏ´Â ½Ãµµ´Â ¸¶¿ì½º¸¦ °¡ÀåÀÚ¸®¿¡ ³²°ÜµÑ °ÍÀÓÀ» ÀǹÌÇÏ´Â wraparound¸¦ À§ÇÑ slackÀÇ ¾ç.
  9. int maxx
    ÇöÀç ´Ü¸»±âÀÇ x ¹æÇâ ÇØ»óµµ. µðÆúÆ® ÆùÆ®, Çѹ®ÀÚ´Â 10Çȼ¿(pixel) Æø(wide)À» °¡Áø overall x È­¸é(screen) ÇØ»óµµ(resolution)´Â 10*80-1ÀÌ´Ù.
  10. int maxy
    ÇöÀç ´Ü¸»±âÀÇ y ¹æÇâ ÇØ»óµµ. µðÆúÆ® ÆùÆ®, Çѹ®ÀÚ´Â 12Çȼ¿(pixel) ³ôÀÌ(high)¸¦ °¡Áø overall y È­¸é(screen) ÇØ»óµµ(resolution)´Â 12*25-1ÀÌ´Ù.

get_ms_event()´Â ´ÜÁö struct ms_event¿¡ ´ëÇÑ Æ÷ÀÎÅ͸¸À» ÇÊ¿ä·Î ÇÑ´Ù. get_ms_event()°¡ -1À» ¹ÝȯÇÑ´Ù¸é, ¿¡·¯°¡ ¹ß»ýÇÑ °ÍÀÌ´Ù. ¼º°ø½Ã 0À» ¹ÝȯÇÏ°í strucr ms_event´Â ½ÇÁ¦ ¸¶¿ì½º »óŸ¦ Æ÷ÇÔÇÒ °ÍÀÌ´Ù.


ÀÌÀü:9 I/O Æ÷Æ® ÇÁ·Î±×·¡¹Ö (Programming I/O ports) ´ÙÀ½:9.2 ¸ðµ© ÇÁ·Î±×·¡¹Ö (Modem Programming)
[¼öÆۺ갡] [ÄÄÇ»ÅÍ°ÔÀÓ] [Àâ´ÙÇѰ͵é]

Copyright (c) 1996,1997 by Euibeom.Hwang & SangEun.Oh All Rights Reserved

Email To:Webmaster , Another address
LAST UPDATE Dec 17,1997
Created Dec 17,1997